<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>spade.xmppd.modules.stream</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="spade-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://spade2.googlecode.com">SPADE</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="spade-module.html">Package&nbsp;spade</a> ::
        <a href="spade.xmppd-module.html">Package&nbsp;xmppd</a> ::
        <a href="spade.xmppd.modules-module.html">Package&nbsp;modules</a> ::
        Module&nbsp;stream
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="spade.xmppd.modules.stream-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="spade.xmppd.modules.stream-module.html">Module spade.xmppd.modules.stream</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-comment"># Distributed under the terms of GPL version 2 or any later</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-comment"># Copyright (C) Kristopher Tate / BlueBridge Technologies Group 2005</tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-comment"># Copyright (C) Alexey Nezhdanov 2004</tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-comment"># Stream-level features for xmppd.py</tt> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Package spade.xmpp=spade.xmpp-module.html"><a title="spade.xmpp" class="py-name" href="#" onclick="return doclink('link-0', 'xmpp', 'link-0');">xmpp</a></tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line">        <tt class="py-keyword">from</tt> <tt id="link-1" class="py-name" targets="Package spade.xmppd=spade.xmppd-module.html,Module spade.xmppd.xmppd=spade.xmppd.xmppd-module.html"><a title="spade.xmppd
spade.xmppd.xmppd" class="py-name" href="#" onclick="return doclink('link-1', 'xmppd', 'link-1');">xmppd</a></tt><tt class="py-op">.</tt><tt id="link-2" class="py-name"><a title="spade.xmppd
spade.xmppd.xmppd" class="py-name" href="#" onclick="return doclink('link-2', 'xmppd', 'link-1');">xmppd</a></tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"><tt class="py-keyword">except</tt><tt class="py-op">:</tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line">        <tt class="py-keyword">from</tt> <tt id="link-3" class="py-name"><a title="spade.xmppd
spade.xmppd.xmppd" class="py-name" href="#" onclick="return doclink('link-3', 'xmppd', 'link-1');">xmppd</a></tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">socket</tt><tt class="py-op">,</tt><tt class="py-name">thread</tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">tlslite</tt><tt class="py-op">.</tt><tt class="py-name">api</tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">hashlib</tt> </tt>
<a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line"> </tt>
<a name="TLS"></a><div id="TLS-def"><a name="L16"></a><tt class="py-lineno"> 16</tt> <a class="py-toggle" href="#" id="TLS-toggle" onclick="return toggle('TLS');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="spade.xmppd.modules.stream.TLS-class.html">TLS</a><tt class="py-op">(</tt><tt class="py-base-class">PlugIn</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="TLS-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="TLS-expanded"><a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line">    <tt class="py-docstring">""" 3.                        &lt;features/&gt;</tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"><tt class="py-docstring">        4. &lt;starttls/&gt;</tt> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"><tt class="py-docstring">        5.                        &lt;proceed/&gt; / &lt;failure/&gt;</tt> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"><tt class="py-docstring">        -- NEW STREAM / connection close --</tt> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line">    <tt id="link-4" class="py-name" targets="Variable spade.xmppd.modules.config.Config.NS=spade.xmppd.modules.config.Config-class.html#NS,Variable spade.xmppd.modules.db_fake.AUTH.NS=spade.xmppd.modules.db_fake.AUTH-class.html#NS,Variable spade.xmppd.modules.db_fake.DB.NS=spade.xmppd.modules.db_fake.DB-class.html#NS,Variable spade.xmppd.modules.dialback.Dialback.NS=spade.xmppd.modules.dialback.Dialback-class.html#NS,Variable spade.xmppd.modules.jep0077.IBR.NS=spade.xmppd.modules.jep0077.IBR-class.html#NS,Variable spade.xmppd.modules.jep0078.NSA.NS=spade.xmppd.modules.jep0078.NSA-class.html#NS,Variable spade.xmppd.modules.message.MessageCatcher.NS=spade.xmppd.modules.message.MessageCatcher-class.html#NS,Variable spade.xmppd.modules.muc.MUC.NS=spade.xmppd.modules.muc.MUC-class.html#NS,Variable spade.xmppd.modules.oob.OOB.NS=spade.xmppd.modules.oob.OOB-class.html#NS,Variable spade.xmppd.modules.pubsub.PubSubServer.NS=spade.xmppd.modules.pubsub.PubSubServer-class.html#NS,Variable spade.xmppd.modules.roster.ROSTER.NS=spade.xmppd.modules.roster.ROSTER-class.html#NS,Variable spade.xmppd.modules.router.Router.NS=spade.xmppd.modules.router.Router-class.html#NS,Variable spade.xmppd.modules.stream.Bind.NS=spade.xmppd.modules.stream.Bind-class.html#NS,Variable spade.xmppd.modules.stream.Handshake.NS=spade.xmppd.modules.stream.Handshake-class.html#NS,Variable spade.xmppd.modules.stream.SASL.NS=spade.xmppd.modules.stream.SASL-class.html#NS,Variable spade.xmppd.modules.stream.Session.NS=spade.xmppd.modules.stream.Session-class.html#NS,Variable spade.xmppd.modules.stream.TLS.NS=spade.xmppd.modules.stream.TLS-class.html#NS,Variable spade.xmppd.modules.webadmin.WebAdmin.NS=spade.xmppd.modules.webadmin.WebAdmin-class.html#NS,Variable spade.xmppd.modules.wq.WQ.NS=spade.xmppd.modules.wq.WQ-class.html#NS"><a title="spade.xmppd.modules.config.Config.NS
spade.xmppd.modules.db_fake.AUTH.NS
spade.xmppd.modules.db_fake.DB.NS
spade.xmppd.modules.dialback.Dialback.NS
spade.xmppd.modules.jep0077.IBR.NS
spade.xmppd.modules.jep0078.NSA.NS
spade.xmppd.modules.message.MessageCatcher.NS
spade.xmppd.modules.muc.MUC.NS
spade.xmppd.modules.oob.OOB.NS
spade.xmppd.modules.pubsub.PubSubServer.NS
spade.xmppd.modules.roster.ROSTER.NS
spade.xmppd.modules.router.Router.NS
spade.xmppd.modules.stream.Bind.NS
spade.xmppd.modules.stream.Handshake.NS
spade.xmppd.modules.stream.SASL.NS
spade.xmppd.modules.stream.Session.NS
spade.xmppd.modules.stream.TLS.NS
spade.xmppd.modules.webadmin.WebAdmin.NS
spade.xmppd.modules.wq.WQ.NS" class="py-name" href="#" onclick="return doclink('link-4', 'NS', 'link-4');">NS</a></tt><tt class="py-op">=</tt><tt id="link-5" class="py-name" targets="Variable spade.Agent.NS_TLS=spade.Agent-module.html#NS_TLS,Variable spade.MTP.NS_TLS=spade.MTP-module.html#NS_TLS,Variable spade.Organization.NS_TLS=spade.Organization-module.html#NS_TLS,Variable spade.Organization_new.NS_TLS=spade.Organization_new-module.html#NS_TLS,Variable spade.Unit.NS_TLS=spade.Unit-module.html#NS_TLS,Variable spade.Unit_new.NS_TLS=spade.Unit_new-module.html#NS_TLS,Variable spade.pubsub.NS_TLS=spade.pubsub-module.html#NS_TLS,Variable spade.socialnetwork.NS_TLS=spade.socialnetwork-module.html#NS_TLS,Variable spade.xmpp.NS_TLS=spade.xmpp-module.html#NS_TLS,Variable spade.xmpp.auth.NS_TLS=spade.xmpp.auth-module.html#NS_TLS,Variable spade.xmpp.browser.NS_TLS=spade.xmpp.browser-module.html#NS_TLS,Variable spade.xmpp.commands.NS_TLS=spade.xmpp.commands-module.html#NS_TLS,Variable spade.xmpp.dispatcher.NS_TLS=spade.xmpp.dispatcher-module.html#NS_TLS,Variable spade.xmpp.features.NS_TLS=spade.xmpp.features-module.html#NS_TLS,Variable spade.xmpp.filetransfer.NS_TLS=spade.xmpp.filetransfer-module.html#NS_TLS,Variable spade.xmpp.protocol.NS_TLS=spade.xmpp.protocol-module.html#NS_TLS,Variable spade.xmpp.roster.NS_TLS=spade.xmpp.roster-module.html#NS_TLS,Variable spade.xmpp.transports.NS_TLS=spade.xmpp.transports-module.html#NS_TLS,Variable spade.xmppd.modules.config.NS_TLS=spade.xmppd.modules.config-module.html#NS_TLS,Variable spade.xmppd.modules.db_fake.NS_TLS=spade.xmppd.modules.db_fake-module.html#NS_TLS,Variable spade.xmppd.modules.dialback.NS_TLS=spade.xmppd.modules.dialback-module.html#NS_TLS,Variable spade.xmppd.modules.jep0077.NS_TLS=spade.xmppd.modules.jep0077-module.html#NS_TLS,Variable spade.xmppd.modules.jep0078.NS_TLS=spade.xmppd.modules.jep0078-module.html#NS_TLS,Variable spade.xmppd.modules.message.NS_TLS=spade.xmppd.modules.message-module.html#NS_TLS,Variable spade.xmppd.modules.muc.NS_TLS=spade.xmppd.modules.muc-module.html#NS_TLS,Variable spade.xmppd.modules.oob.NS_TLS=spade.xmppd.modules.oob-module.html#NS_TLS,Variable spade.xmppd.modules.pubsub.NS_TLS=spade.xmppd.modules.pubsub-module.html#NS_TLS,Variable spade.xmppd.modules.roster.NS_TLS=spade.xmppd.modules.roster-module.html#NS_TLS,Variable spade.xmppd.modules.router.NS_TLS=spade.xmppd.modules.router-module.html#NS_TLS,Variable spade.xmppd.modules.stream.NS_TLS=spade.xmppd.modules.stream-module.html#NS_TLS,Variable spade.xmppd.modules.webadmin.NS_TLS=spade.xmppd.modules.webadmin-module.html#NS_TLS,Variable spade.xmppd.modules.wq.NS_TLS=spade.xmppd.modules.wq-module.html#NS_TLS,Variable spade.xmppd.xmppd.NS_TLS=spade.xmppd.xmppd-module.html#NS_TLS"><a title="spade.Agent.NS_TLS
spade.MTP.NS_TLS
spade.Organization.NS_TLS
spade.Organization_new.NS_TLS
spade.Unit.NS_TLS
spade.Unit_new.NS_TLS
spade.pubsub.NS_TLS
spade.socialnetwork.NS_TLS
spade.xmpp.NS_TLS
spade.xmpp.auth.NS_TLS
spade.xmpp.browser.NS_TLS
spade.xmpp.commands.NS_TLS
spade.xmpp.dispatcher.NS_TLS
spade.xmpp.features.NS_TLS
spade.xmpp.filetransfer.NS_TLS
spade.xmpp.protocol.NS_TLS
spade.xmpp.roster.NS_TLS
spade.xmpp.transports.NS_TLS
spade.xmppd.modules.config.NS_TLS
spade.xmppd.modules.db_fake.NS_TLS
spade.xmppd.modules.dialback.NS_TLS
spade.xmppd.modules.jep0077.NS_TLS
spade.xmppd.modules.jep0078.NS_TLS
spade.xmppd.modules.message.NS_TLS
spade.xmppd.modules.muc.NS_TLS
spade.xmppd.modules.oob.NS_TLS
spade.xmppd.modules.pubsub.NS_TLS
spade.xmppd.modules.roster.NS_TLS
spade.xmppd.modules.router.NS_TLS
spade.xmppd.modules.stream.NS_TLS
spade.xmppd.modules.webadmin.NS_TLS
spade.xmppd.modules.wq.NS_TLS
spade.xmppd.xmppd.NS_TLS" class="py-name" href="#" onclick="return doclink('link-5', 'NS_TLS', 'link-5');">NS_TLS</a></tt> </tt>
<a name="TLS.plugin"></a><div id="TLS.plugin-def"><a name="L23"></a><tt class="py-lineno"> 23</tt> <a class="py-toggle" href="#" id="TLS.plugin-toggle" onclick="return toggle('TLS.plugin');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="spade.xmppd.modules.stream.TLS-class.html#plugin">plugin</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">server</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="TLS.plugin-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="TLS.plugin-expanded"><a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line">        <tt class="py-name">server</tt><tt class="py-op">.</tt><tt id="link-6" class="py-name" targets="Class spade.xmpp.dispatcher.Dispatcher=spade.xmpp.dispatcher.Dispatcher-class.html"><a title="spade.xmpp.dispatcher.Dispatcher" class="py-name" href="#" onclick="return doclink('link-6', 'Dispatcher', 'link-6');">Dispatcher</a></tt><tt class="py-op">.</tt><tt id="link-7" class="py-name" targets="Method spade.xmpp.dispatcher.Dispatcher.RegisterHandler()=spade.xmpp.dispatcher.Dispatcher-class.html#RegisterHandler"><a title="spade.xmpp.dispatcher.Dispatcher.RegisterHandler" class="py-name" href="#" onclick="return doclink('link-7', 'RegisterHandler', 'link-7');">RegisterHandler</a></tt><tt class="py-op">(</tt><tt class="py-string">'starttls'</tt><tt class="py-op">,</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-8" class="py-name" targets="Method spade.xmppd.modules.stream.TLS.starttlsHandler()=spade.xmppd.modules.stream.TLS-class.html#starttlsHandler"><a title="spade.xmppd.modules.stream.TLS.starttlsHandler" class="py-name" href="#" onclick="return doclink('link-8', 'starttlsHandler', 'link-8');">starttlsHandler</a></tt><tt class="py-op">,</tt><tt class="py-name">xmlns</tt><tt class="py-op">=</tt><tt id="link-9" class="py-name"><a title="spade.Agent.NS_TLS
spade.MTP.NS_TLS
spade.Organization.NS_TLS
spade.Organization_new.NS_TLS
spade.Unit.NS_TLS
spade.Unit_new.NS_TLS
spade.pubsub.NS_TLS
spade.socialnetwork.NS_TLS
spade.xmpp.NS_TLS
spade.xmpp.auth.NS_TLS
spade.xmpp.browser.NS_TLS
spade.xmpp.commands.NS_TLS
spade.xmpp.dispatcher.NS_TLS
spade.xmpp.features.NS_TLS
spade.xmpp.filetransfer.NS_TLS
spade.xmpp.protocol.NS_TLS
spade.xmpp.roster.NS_TLS
spade.xmpp.transports.NS_TLS
spade.xmppd.modules.config.NS_TLS
spade.xmppd.modules.db_fake.NS_TLS
spade.xmppd.modules.dialback.NS_TLS
spade.xmppd.modules.jep0077.NS_TLS
spade.xmppd.modules.jep0078.NS_TLS
spade.xmppd.modules.message.NS_TLS
spade.xmppd.modules.muc.NS_TLS
spade.xmppd.modules.oob.NS_TLS
spade.xmppd.modules.pubsub.NS_TLS
spade.xmppd.modules.roster.NS_TLS
spade.xmppd.modules.router.NS_TLS
spade.xmppd.modules.stream.NS_TLS
spade.xmppd.modules.webadmin.NS_TLS
spade.xmppd.modules.wq.NS_TLS
spade.xmppd.xmppd.NS_TLS" class="py-name" href="#" onclick="return doclink('link-9', 'NS_TLS', 'link-5');">NS_TLS</a></tt><tt class="py-op">)</tt> </tt>
<a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line">        <tt class="py-name">server</tt><tt class="py-op">.</tt><tt id="link-10" class="py-name"><a title="spade.xmpp.dispatcher.Dispatcher" class="py-name" href="#" onclick="return doclink('link-10', 'Dispatcher', 'link-6');">Dispatcher</a></tt><tt class="py-op">.</tt><tt id="link-11" class="py-name"><a title="spade.xmpp.dispatcher.Dispatcher.RegisterHandler" class="py-name" href="#" onclick="return doclink('link-11', 'RegisterHandler', 'link-7');">RegisterHandler</a></tt><tt class="py-op">(</tt><tt class="py-string">'proceed'</tt><tt class="py-op">,</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-12" class="py-name" targets="Method spade.xmppd.modules.stream.TLS.proceedfailureHandler()=spade.xmppd.modules.stream.TLS-class.html#proceedfailureHandler"><a title="spade.xmppd.modules.stream.TLS.proceedfailureHandler" class="py-name" href="#" onclick="return doclink('link-12', 'proceedfailureHandler', 'link-12');">proceedfailureHandler</a></tt><tt class="py-op">,</tt><tt class="py-name">xmlns</tt><tt class="py-op">=</tt><tt id="link-13" class="py-name"><a title="spade.Agent.NS_TLS
spade.MTP.NS_TLS
spade.Organization.NS_TLS
spade.Organization_new.NS_TLS
spade.Unit.NS_TLS
spade.Unit_new.NS_TLS
spade.pubsub.NS_TLS
spade.socialnetwork.NS_TLS
spade.xmpp.NS_TLS
spade.xmpp.auth.NS_TLS
spade.xmpp.browser.NS_TLS
spade.xmpp.commands.NS_TLS
spade.xmpp.dispatcher.NS_TLS
spade.xmpp.features.NS_TLS
spade.xmpp.filetransfer.NS_TLS
spade.xmpp.protocol.NS_TLS
spade.xmpp.roster.NS_TLS
spade.xmpp.transports.NS_TLS
spade.xmppd.modules.config.NS_TLS
spade.xmppd.modules.db_fake.NS_TLS
spade.xmppd.modules.dialback.NS_TLS
spade.xmppd.modules.jep0077.NS_TLS
spade.xmppd.modules.jep0078.NS_TLS
spade.xmppd.modules.message.NS_TLS
spade.xmppd.modules.muc.NS_TLS
spade.xmppd.modules.oob.NS_TLS
spade.xmppd.modules.pubsub.NS_TLS
spade.xmppd.modules.roster.NS_TLS
spade.xmppd.modules.router.NS_TLS
spade.xmppd.modules.stream.NS_TLS
spade.xmppd.modules.webadmin.NS_TLS
spade.xmppd.modules.wq.NS_TLS
spade.xmppd.xmppd.NS_TLS" class="py-name" href="#" onclick="return doclink('link-13', 'NS_TLS', 'link-5');">NS_TLS</a></tt><tt class="py-op">)</tt> </tt>
<a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line">        <tt class="py-name">server</tt><tt class="py-op">.</tt><tt id="link-14" class="py-name"><a title="spade.xmpp.dispatcher.Dispatcher" class="py-name" href="#" onclick="return doclink('link-14', 'Dispatcher', 'link-6');">Dispatcher</a></tt><tt class="py-op">.</tt><tt id="link-15" class="py-name"><a title="spade.xmpp.dispatcher.Dispatcher.RegisterHandler" class="py-name" href="#" onclick="return doclink('link-15', 'RegisterHandler', 'link-7');">RegisterHandler</a></tt><tt class="py-op">(</tt><tt class="py-string">'failure'</tt><tt class="py-op">,</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-16" class="py-name"><a title="spade.xmppd.modules.stream.TLS.proceedfailureHandler" class="py-name" href="#" onclick="return doclink('link-16', 'proceedfailureHandler', 'link-12');">proceedfailureHandler</a></tt><tt class="py-op">,</tt><tt class="py-name">xmlns</tt><tt class="py-op">=</tt><tt id="link-17" class="py-name"><a title="spade.Agent.NS_TLS
spade.MTP.NS_TLS
spade.Organization.NS_TLS
spade.Organization_new.NS_TLS
spade.Unit.NS_TLS
spade.Unit_new.NS_TLS
spade.pubsub.NS_TLS
spade.socialnetwork.NS_TLS
spade.xmpp.NS_TLS
spade.xmpp.auth.NS_TLS
spade.xmpp.browser.NS_TLS
spade.xmpp.commands.NS_TLS
spade.xmpp.dispatcher.NS_TLS
spade.xmpp.features.NS_TLS
spade.xmpp.filetransfer.NS_TLS
spade.xmpp.protocol.NS_TLS
spade.xmpp.roster.NS_TLS
spade.xmpp.transports.NS_TLS
spade.xmppd.modules.config.NS_TLS
spade.xmppd.modules.db_fake.NS_TLS
spade.xmppd.modules.dialback.NS_TLS
spade.xmppd.modules.jep0077.NS_TLS
spade.xmppd.modules.jep0078.NS_TLS
spade.xmppd.modules.message.NS_TLS
spade.xmppd.modules.muc.NS_TLS
spade.xmppd.modules.oob.NS_TLS
spade.xmppd.modules.pubsub.NS_TLS
spade.xmppd.modules.roster.NS_TLS
spade.xmppd.modules.router.NS_TLS
spade.xmppd.modules.stream.NS_TLS
spade.xmppd.modules.webadmin.NS_TLS
spade.xmppd.modules.wq.NS_TLS
spade.xmppd.xmppd.NS_TLS" class="py-name" href="#" onclick="return doclink('link-17', 'NS_TLS', 'link-5');">NS_TLS</a></tt><tt class="py-op">)</tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line">        <tt class="py-name">server</tt><tt class="py-op">.</tt><tt id="link-18" class="py-name"><a title="spade.xmpp.dispatcher.Dispatcher" class="py-name" href="#" onclick="return doclink('link-18', 'Dispatcher', 'link-6');">Dispatcher</a></tt><tt class="py-op">.</tt><tt id="link-19" class="py-name"><a title="spade.xmpp.dispatcher.Dispatcher.RegisterHandler" class="py-name" href="#" onclick="return doclink('link-19', 'RegisterHandler', 'link-7');">RegisterHandler</a></tt><tt class="py-op">(</tt><tt class="py-string">'features'</tt><tt class="py-op">,</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-20" class="py-name" targets="Method spade.xmpp.auth.Bind.FeaturesHandler()=spade.xmpp.auth.Bind-class.html#FeaturesHandler,Method spade.xmpp.auth.ComponentBind.FeaturesHandler()=spade.xmpp.auth.ComponentBind-class.html#FeaturesHandler,Method spade.xmpp.auth.SASL.FeaturesHandler()=spade.xmpp.auth.SASL-class.html#FeaturesHandler,Method spade.xmpp.transports.TLS.FeaturesHandler()=spade.xmpp.transports.TLS-class.html#FeaturesHandler,Method spade.xmppd.modules.dialback.Dialback.FeaturesHandler()=spade.xmppd.modules.dialback.Dialback-class.html#FeaturesHandler,Method spade.xmppd.modules.stream.TLS.FeaturesHandler()=spade.xmppd.modules.stream.TLS-class.html#FeaturesHandler"><a title="spade.xmpp.auth.Bind.FeaturesHandler
spade.xmpp.auth.ComponentBind.FeaturesHandler
spade.xmpp.auth.SASL.FeaturesHandler
spade.xmpp.transports.TLS.FeaturesHandler
spade.xmppd.modules.dialback.Dialback.FeaturesHandler
spade.xmppd.modules.stream.TLS.FeaturesHandler" class="py-name" href="#" onclick="return doclink('link-20', 'FeaturesHandler', 'link-20');">FeaturesHandler</a></tt><tt class="py-op">,</tt><tt class="py-name">xmlns</tt><tt class="py-op">=</tt><tt id="link-21" class="py-name" targets="Variable spade.Agent.NS_STREAMS=spade.Agent-module.html#NS_STREAMS,Variable spade.MTP.NS_STREAMS=spade.MTP-module.html#NS_STREAMS,Variable spade.Organization.NS_STREAMS=spade.Organization-module.html#NS_STREAMS,Variable spade.Organization_new.NS_STREAMS=spade.Organization_new-module.html#NS_STREAMS,Variable spade.Unit.NS_STREAMS=spade.Unit-module.html#NS_STREAMS,Variable spade.Unit_new.NS_STREAMS=spade.Unit_new-module.html#NS_STREAMS,Variable spade.pubsub.NS_STREAMS=spade.pubsub-module.html#NS_STREAMS,Variable spade.socialnetwork.NS_STREAMS=spade.socialnetwork-module.html#NS_STREAMS,Variable spade.xmpp.NS_STREAMS=spade.xmpp-module.html#NS_STREAMS,Variable spade.xmpp.auth.NS_STREAMS=spade.xmpp.auth-module.html#NS_STREAMS,Variable spade.xmpp.browser.NS_STREAMS=spade.xmpp.browser-module.html#NS_STREAMS,Variable spade.xmpp.commands.NS_STREAMS=spade.xmpp.commands-module.html#NS_STREAMS,Variable spade.xmpp.dispatcher.NS_STREAMS=spade.xmpp.dispatcher-module.html#NS_STREAMS,Variable spade.xmpp.features.NS_STREAMS=spade.xmpp.features-module.html#NS_STREAMS,Variable spade.xmpp.filetransfer.NS_STREAMS=spade.xmpp.filetransfer-module.html#NS_STREAMS,Variable spade.xmpp.protocol.NS_STREAMS=spade.xmpp.protocol-module.html#NS_STREAMS,Variable spade.xmpp.roster.NS_STREAMS=spade.xmpp.roster-module.html#NS_STREAMS,Variable spade.xmpp.transports.NS_STREAMS=spade.xmpp.transports-module.html#NS_STREAMS,Variable spade.xmppd.modules.config.NS_STREAMS=spade.xmppd.modules.config-module.html#NS_STREAMS,Variable spade.xmppd.modules.db_fake.NS_STREAMS=spade.xmppd.modules.db_fake-module.html#NS_STREAMS,Variable spade.xmppd.modules.dialback.NS_STREAMS=spade.xmppd.modules.dialback-module.html#NS_STREAMS,Variable spade.xmppd.modules.jep0077.NS_STREAMS=spade.xmppd.modules.jep0077-module.html#NS_STREAMS,Variable spade.xmppd.modules.jep0078.NS_STREAMS=spade.xmppd.modules.jep0078-module.html#NS_STREAMS,Variable spade.xmppd.modules.message.NS_STREAMS=spade.xmppd.modules.message-module.html#NS_STREAMS,Variable spade.xmppd.modules.muc.NS_STREAMS=spade.xmppd.modules.muc-module.html#NS_STREAMS,Variable spade.xmppd.modules.oob.NS_STREAMS=spade.xmppd.modules.oob-module.html#NS_STREAMS,Variable spade.xmppd.modules.pubsub.NS_STREAMS=spade.xmppd.modules.pubsub-module.html#NS_STREAMS,Variable spade.xmppd.modules.roster.NS_STREAMS=spade.xmppd.modules.roster-module.html#NS_STREAMS,Variable spade.xmppd.modules.router.NS_STREAMS=spade.xmppd.modules.router-module.html#NS_STREAMS,Variable spade.xmppd.modules.stream.NS_STREAMS=spade.xmppd.modules.stream-module.html#NS_STREAMS,Variable spade.xmppd.modules.webadmin.NS_STREAMS=spade.xmppd.modules.webadmin-module.html#NS_STREAMS,Variable spade.xmppd.modules.wq.NS_STREAMS=spade.xmppd.modules.wq-module.html#NS_STREAMS,Variable spade.xmppd.xmppd.NS_STREAMS=spade.xmppd.xmppd-module.html#NS_STREAMS"><a title="spade.Agent.NS_STREAMS
spade.MTP.NS_STREAMS
spade.Organization.NS_STREAMS
spade.Organization_new.NS_STREAMS
spade.Unit.NS_STREAMS
spade.Unit_new.NS_STREAMS
spade.pubsub.NS_STREAMS
spade.socialnetwork.NS_STREAMS
spade.xmpp.NS_STREAMS
spade.xmpp.auth.NS_STREAMS
spade.xmpp.browser.NS_STREAMS
spade.xmpp.commands.NS_STREAMS
spade.xmpp.dispatcher.NS_STREAMS
spade.xmpp.features.NS_STREAMS
spade.xmpp.filetransfer.NS_STREAMS
spade.xmpp.protocol.NS_STREAMS
spade.xmpp.roster.NS_STREAMS
spade.xmpp.transports.NS_STREAMS
spade.xmppd.modules.config.NS_STREAMS
spade.xmppd.modules.db_fake.NS_STREAMS
spade.xmppd.modules.dialback.NS_STREAMS
spade.xmppd.modules.jep0077.NS_STREAMS
spade.xmppd.modules.jep0078.NS_STREAMS
spade.xmppd.modules.message.NS_STREAMS
spade.xmppd.modules.muc.NS_STREAMS
spade.xmppd.modules.oob.NS_STREAMS
spade.xmppd.modules.pubsub.NS_STREAMS
spade.xmppd.modules.roster.NS_STREAMS
spade.xmppd.modules.router.NS_STREAMS
spade.xmppd.modules.stream.NS_STREAMS
spade.xmppd.modules.webadmin.NS_STREAMS
spade.xmppd.modules.wq.NS_STREAMS
spade.xmppd.xmppd.NS_STREAMS" class="py-name" href="#" onclick="return doclink('link-21', 'NS_STREAMS', 'link-21');">NS_STREAMS</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line"> </tt>
<a name="TLS.starttlsHandler"></a><div id="TLS.starttlsHandler-def"><a name="L29"></a><tt class="py-lineno"> 29</tt> <a class="py-toggle" href="#" id="TLS.starttlsHandler-toggle" onclick="return toggle('TLS.starttlsHandler');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="spade.xmppd.modules.stream.TLS-class.html#starttlsHandler">starttlsHandler</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">session</tt><tt class="py-op">,</tt><tt class="py-param">stanza</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="TLS.starttlsHandler-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="TLS.starttlsHandler-expanded"><a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line">        <tt class="py-comment">#print stanza</tt> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-string">'tls'</tt> <tt class="py-keyword">in</tt> <tt id="link-22" class="py-name" targets="Module spade.xmpp.session=spade.xmpp.session-module.html"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-22', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-23" class="py-name" targets="Module spade.xmpp.features=spade.xmpp.features-module.html"><a title="spade.xmpp.features" class="py-name" href="#" onclick="return doclink('link-23', 'features', 'link-23');">features</a></tt><tt class="py-op">:</tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line">            <tt id="link-24" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-24', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-25" class="py-name" targets="Method spade.Agent.AbstractAgent.send()=spade.Agent.AbstractAgent-class.html#send,Method spade.MTP.MTP.send()=spade.MTP.MTP-class.html#send,Method spade.xmpp.dispatcher.Dispatcher.send()=spade.xmpp.dispatcher.Dispatcher-class.html#send,Method spade.xmpp.transports.TCPsocket.send()=spade.xmpp.transports.TCPsocket-class.html#send,Method spade.xmppd.xmppd.RPC_Client.send()=spade.xmppd.xmppd.RPC_Client-class.html#send,Method spade.xmppd.xmppd.Session.send()=spade.xmppd.xmppd.Session-class.html#send"><a title="spade.Agent.AbstractAgent.send
spade.MTP.MTP.send
spade.xmpp.dispatcher.Dispatcher.send
spade.xmpp.transports.TCPsocket.send
spade.xmppd.xmppd.RPC_Client.send
spade.xmppd.xmppd.Session.send" class="py-name" href="#" onclick="return doclink('link-25', 'send', 'link-25');">send</a></tt><tt class="py-op">(</tt><tt id="link-26" class="py-name" targets="Class spade.xmpp.simplexml.Node=spade.xmpp.simplexml.Node-class.html"><a title="spade.xmpp.simplexml.Node" class="py-name" href="#" onclick="return doclink('link-26', 'Node', 'link-26');">Node</a></tt><tt class="py-op">(</tt><tt class="py-string">'failure'</tt><tt class="py-op">,</tt><tt class="py-op">{</tt><tt class="py-string">'xmlns'</tt><tt class="py-op">:</tt><tt id="link-27" class="py-name"><a title="spade.Agent.NS_TLS
spade.MTP.NS_TLS
spade.Organization.NS_TLS
spade.Organization_new.NS_TLS
spade.Unit.NS_TLS
spade.Unit_new.NS_TLS
spade.pubsub.NS_TLS
spade.socialnetwork.NS_TLS
spade.xmpp.NS_TLS
spade.xmpp.auth.NS_TLS
spade.xmpp.browser.NS_TLS
spade.xmpp.commands.NS_TLS
spade.xmpp.dispatcher.NS_TLS
spade.xmpp.features.NS_TLS
spade.xmpp.filetransfer.NS_TLS
spade.xmpp.protocol.NS_TLS
spade.xmpp.roster.NS_TLS
spade.xmpp.transports.NS_TLS
spade.xmppd.modules.config.NS_TLS
spade.xmppd.modules.db_fake.NS_TLS
spade.xmppd.modules.dialback.NS_TLS
spade.xmppd.modules.jep0077.NS_TLS
spade.xmppd.modules.jep0078.NS_TLS
spade.xmppd.modules.message.NS_TLS
spade.xmppd.modules.muc.NS_TLS
spade.xmppd.modules.oob.NS_TLS
spade.xmppd.modules.pubsub.NS_TLS
spade.xmppd.modules.roster.NS_TLS
spade.xmppd.modules.router.NS_TLS
spade.xmppd.modules.stream.NS_TLS
spade.xmppd.modules.webadmin.NS_TLS
spade.xmppd.modules.wq.NS_TLS
spade.xmppd.xmppd.NS_TLS" class="py-name" href="#" onclick="return doclink('link-27', 'NS_TLS', 'link-5');">NS_TLS</a></tt><tt class="py-op">}</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-28" class="py-name" targets="Method spade.Agent.AbstractAgent.DEBUG()=spade.Agent.AbstractAgent-class.html#DEBUG,Method spade.spade_backend.SpadeBackend.DEBUG()=spade.spade_backend.SpadeBackend-class.html#DEBUG,Method spade.xmpp.client.PlugIn.DEBUG()=spade.xmpp.client.PlugIn-class.html#DEBUG,Method spade.xmpp.simplexml.NodeBuilder.DEBUG()=spade.xmpp.simplexml.NodeBuilder-class.html#DEBUG,Method spade.xmpp.transports.HTTPPROXYsocket.DEBUG()=spade.xmpp.transports.HTTPPROXYsocket-class.html#DEBUG"><a title="spade.Agent.AbstractAgent.DEBUG
spade.spade_backend.SpadeBackend.DEBUG
spade.xmpp.client.PlugIn.DEBUG
spade.xmpp.simplexml.NodeBuilder.DEBUG
spade.xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-28', 'DEBUG', 'link-28');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">'TLS startup failure: already started.'</tt><tt class="py-op">,</tt><tt class="py-string">'error'</tt><tt class="py-op">)</tt> </tt>
<a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line">            <tt id="link-29" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-29', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-30" class="py-name" targets="Method spade.xmpp.session.Session.unfeature()=spade.xmpp.session.Session-class.html#unfeature,Method spade.xmppd.xmppd.Server.unfeature()=spade.xmppd.xmppd.Server-class.html#unfeature,Method spade.xmppd.xmppd.Session.unfeature()=spade.xmppd.xmppd.Session-class.html#unfeature"><a title="spade.xmpp.session.Session.unfeature
spade.xmppd.xmppd.Server.unfeature
spade.xmppd.xmppd.Session.unfeature" class="py-name" href="#" onclick="return doclink('link-30', 'unfeature', 'link-30');">unfeature</a></tt><tt class="py-op">(</tt><tt id="link-31" class="py-name"><a title="spade.Agent.NS_TLS
spade.MTP.NS_TLS
spade.Organization.NS_TLS
spade.Organization_new.NS_TLS
spade.Unit.NS_TLS
spade.Unit_new.NS_TLS
spade.pubsub.NS_TLS
spade.socialnetwork.NS_TLS
spade.xmpp.NS_TLS
spade.xmpp.auth.NS_TLS
spade.xmpp.browser.NS_TLS
spade.xmpp.commands.NS_TLS
spade.xmpp.dispatcher.NS_TLS
spade.xmpp.features.NS_TLS
spade.xmpp.filetransfer.NS_TLS
spade.xmpp.protocol.NS_TLS
spade.xmpp.roster.NS_TLS
spade.xmpp.transports.NS_TLS
spade.xmppd.modules.config.NS_TLS
spade.xmppd.modules.db_fake.NS_TLS
spade.xmppd.modules.dialback.NS_TLS
spade.xmppd.modules.jep0077.NS_TLS
spade.xmppd.modules.jep0078.NS_TLS
spade.xmppd.modules.message.NS_TLS
spade.xmppd.modules.muc.NS_TLS
spade.xmppd.modules.oob.NS_TLS
spade.xmppd.modules.pubsub.NS_TLS
spade.xmppd.modules.roster.NS_TLS
spade.xmppd.modules.router.NS_TLS
spade.xmppd.modules.stream.NS_TLS
spade.xmppd.modules.webadmin.NS_TLS
spade.xmppd.modules.wq.NS_TLS
spade.xmppd.xmppd.NS_TLS" class="py-name" href="#" onclick="return doclink('link-31', 'NS_TLS', 'link-5');">NS_TLS</a></tt><tt class="py-op">)</tt> </tt>
<a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt id="link-32" class="py-name" targets="Class spade.xmpp.protocol.NodeProcessed=spade.xmpp.protocol.NodeProcessed-class.html"><a title="spade.xmpp.protocol.NodeProcessed" class="py-name" href="#" onclick="return doclink('link-32', 'NodeProcessed', 'link-32');">NodeProcessed</a></tt> </tt>
<a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt class="py-name">__dict__</tt><tt class="py-op">.</tt><tt class="py-name">has_key</tt><tt class="py-op">(</tt><tt class="py-string">'sslcertfile'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-name">certfile</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt class="py-name">sslcertfile</tt> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> <tt class="py-name">certfile</tt><tt class="py-op">=</tt><tt class="py-name">None</tt> </tt>
<a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt class="py-name">__dict__</tt><tt class="py-op">.</tt><tt class="py-name">has_key</tt><tt class="py-op">(</tt><tt class="py-string">'sslkeyfile'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-name">keyfile</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt id="link-33" class="py-name" targets="Variable spade.xmppd.modules.config.sslkeyfile=spade.xmppd.modules.config-module.html#sslkeyfile"><a title="spade.xmppd.modules.config.sslkeyfile" class="py-name" href="#" onclick="return doclink('link-33', 'sslkeyfile', 'link-33');">sslkeyfile</a></tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> <tt class="py-name">keyfile</tt><tt class="py-op">=</tt><tt class="py-name">certfile</tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> <tt id="link-34" class="py-name" targets="Method spade.dblite.Base.open()=spade.dblite.Base-class.html#open"><a title="spade.dblite.Base.open" class="py-name" href="#" onclick="return doclink('link-34', 'open', 'link-34');">open</a></tt><tt class="py-op">(</tt><tt class="py-name">certfile</tt><tt class="py-op">)</tt> <tt class="py-op">;</tt> <tt id="link-35" class="py-name"><a title="spade.dblite.Base.open" class="py-name" href="#" onclick="return doclink('link-35', 'open', 'link-34');">open</a></tt><tt class="py-op">(</tt><tt class="py-name">keyfile</tt><tt class="py-op">)</tt> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt><tt class="py-op">:</tt> <tt class="py-name">certfile</tt><tt class="py-op">=</tt><tt class="py-name">None</tt> </tt>
<a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">certfile</tt> <tt class="py-keyword">or</tt> <tt class="py-keyword">not</tt> <tt class="py-name">keyfile</tt><tt class="py-op">:</tt> </tt>
<a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line">            <tt id="link-36" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-36', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-37" class="py-name"><a title="spade.Agent.AbstractAgent.send
spade.MTP.MTP.send
spade.xmpp.dispatcher.Dispatcher.send
spade.xmpp.transports.TCPsocket.send
spade.xmppd.xmppd.RPC_Client.send
spade.xmppd.xmppd.Session.send" class="py-name" href="#" onclick="return doclink('link-37', 'send', 'link-25');">send</a></tt><tt class="py-op">(</tt><tt id="link-38" class="py-name"><a title="spade.xmpp.simplexml.Node" class="py-name" href="#" onclick="return doclink('link-38', 'Node', 'link-26');">Node</a></tt><tt class="py-op">(</tt><tt class="py-string">'failure'</tt><tt class="py-op">,</tt><tt class="py-op">{</tt><tt class="py-string">'xmlns'</tt><tt class="py-op">:</tt><tt id="link-39" class="py-name"><a title="spade.Agent.NS_TLS
spade.MTP.NS_TLS
spade.Organization.NS_TLS
spade.Organization_new.NS_TLS
spade.Unit.NS_TLS
spade.Unit_new.NS_TLS
spade.pubsub.NS_TLS
spade.socialnetwork.NS_TLS
spade.xmpp.NS_TLS
spade.xmpp.auth.NS_TLS
spade.xmpp.browser.NS_TLS
spade.xmpp.commands.NS_TLS
spade.xmpp.dispatcher.NS_TLS
spade.xmpp.features.NS_TLS
spade.xmpp.filetransfer.NS_TLS
spade.xmpp.protocol.NS_TLS
spade.xmpp.roster.NS_TLS
spade.xmpp.transports.NS_TLS
spade.xmppd.modules.config.NS_TLS
spade.xmppd.modules.db_fake.NS_TLS
spade.xmppd.modules.dialback.NS_TLS
spade.xmppd.modules.jep0077.NS_TLS
spade.xmppd.modules.jep0078.NS_TLS
spade.xmppd.modules.message.NS_TLS
spade.xmppd.modules.muc.NS_TLS
spade.xmppd.modules.oob.NS_TLS
spade.xmppd.modules.pubsub.NS_TLS
spade.xmppd.modules.roster.NS_TLS
spade.xmppd.modules.router.NS_TLS
spade.xmppd.modules.stream.NS_TLS
spade.xmppd.modules.webadmin.NS_TLS
spade.xmppd.modules.wq.NS_TLS
spade.xmppd.xmppd.NS_TLS" class="py-name" href="#" onclick="return doclink('link-39', 'NS_TLS', 'link-5');">NS_TLS</a></tt><tt class="py-op">}</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-40" class="py-name"><a title="spade.Agent.AbstractAgent.DEBUG
spade.spade_backend.SpadeBackend.DEBUG
spade.xmpp.client.PlugIn.DEBUG
spade.xmpp.simplexml.NodeBuilder.DEBUG
spade.xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-40', 'DEBUG', 'link-28');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">'TLS startup failure: can\'t find SSL cert/key file[s].'</tt><tt class="py-op">,</tt><tt class="py-string">'error'</tt><tt class="py-op">)</tt> </tt>
<a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line">            <tt id="link-41" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-41', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-42" class="py-name"><a title="spade.xmpp.session.Session.unfeature
spade.xmppd.xmppd.Server.unfeature
spade.xmppd.xmppd.Session.unfeature" class="py-name" href="#" onclick="return doclink('link-42', 'unfeature', 'link-30');">unfeature</a></tt><tt class="py-op">(</tt><tt id="link-43" class="py-name"><a title="spade.Agent.NS_TLS
spade.MTP.NS_TLS
spade.Organization.NS_TLS
spade.Organization_new.NS_TLS
spade.Unit.NS_TLS
spade.Unit_new.NS_TLS
spade.pubsub.NS_TLS
spade.socialnetwork.NS_TLS
spade.xmpp.NS_TLS
spade.xmpp.auth.NS_TLS
spade.xmpp.browser.NS_TLS
spade.xmpp.commands.NS_TLS
spade.xmpp.dispatcher.NS_TLS
spade.xmpp.features.NS_TLS
spade.xmpp.filetransfer.NS_TLS
spade.xmpp.protocol.NS_TLS
spade.xmpp.roster.NS_TLS
spade.xmpp.transports.NS_TLS
spade.xmppd.modules.config.NS_TLS
spade.xmppd.modules.db_fake.NS_TLS
spade.xmppd.modules.dialback.NS_TLS
spade.xmppd.modules.jep0077.NS_TLS
spade.xmppd.modules.jep0078.NS_TLS
spade.xmppd.modules.message.NS_TLS
spade.xmppd.modules.muc.NS_TLS
spade.xmppd.modules.oob.NS_TLS
spade.xmppd.modules.pubsub.NS_TLS
spade.xmppd.modules.roster.NS_TLS
spade.xmppd.modules.router.NS_TLS
spade.xmppd.modules.stream.NS_TLS
spade.xmppd.modules.webadmin.NS_TLS
spade.xmppd.modules.wq.NS_TLS
spade.xmppd.xmppd.NS_TLS" class="py-name" href="#" onclick="return doclink('link-43', 'NS_TLS', 'link-5');">NS_TLS</a></tt><tt class="py-op">)</tt>    <tt class="py-comment"># do not declare TLS anymore</tt> </tt>
<a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line">            <tt id="link-44" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-44', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-45" class="py-name" targets="Method spade.xmpp.session.Session.stop_feature()=spade.xmpp.session.Session-class.html#stop_feature,Method spade.xmppd.xmppd.Session.stop_feature()=spade.xmppd.xmppd.Session-class.html#stop_feature"><a title="spade.xmpp.session.Session.stop_feature
spade.xmppd.xmppd.Session.stop_feature" class="py-name" href="#" onclick="return doclink('link-45', 'stop_feature', 'link-45');">stop_feature</a></tt><tt class="py-op">(</tt><tt id="link-46" class="py-name"><a title="spade.Agent.NS_TLS
spade.MTP.NS_TLS
spade.Organization.NS_TLS
spade.Organization_new.NS_TLS
spade.Unit.NS_TLS
spade.Unit_new.NS_TLS
spade.pubsub.NS_TLS
spade.socialnetwork.NS_TLS
spade.xmpp.NS_TLS
spade.xmpp.auth.NS_TLS
spade.xmpp.browser.NS_TLS
spade.xmpp.commands.NS_TLS
spade.xmpp.dispatcher.NS_TLS
spade.xmpp.features.NS_TLS
spade.xmpp.filetransfer.NS_TLS
spade.xmpp.protocol.NS_TLS
spade.xmpp.roster.NS_TLS
spade.xmpp.transports.NS_TLS
spade.xmppd.modules.config.NS_TLS
spade.xmppd.modules.db_fake.NS_TLS
spade.xmppd.modules.dialback.NS_TLS
spade.xmppd.modules.jep0077.NS_TLS
spade.xmppd.modules.jep0078.NS_TLS
spade.xmppd.modules.message.NS_TLS
spade.xmppd.modules.muc.NS_TLS
spade.xmppd.modules.oob.NS_TLS
spade.xmppd.modules.pubsub.NS_TLS
spade.xmppd.modules.roster.NS_TLS
spade.xmppd.modules.router.NS_TLS
spade.xmppd.modules.stream.NS_TLS
spade.xmppd.modules.webadmin.NS_TLS
spade.xmppd.modules.wq.NS_TLS
spade.xmppd.xmppd.NS_TLS" class="py-name" href="#" onclick="return doclink('link-46', 'NS_TLS', 'link-5');">NS_TLS</a></tt><tt class="py-op">)</tt> <tt class="py-comment"># TLS finished, let another features start</tt> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line">            <tt id="link-47" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-47', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-48" class="py-name"><a title="spade.Agent.AbstractAgent.send
spade.MTP.MTP.send
spade.xmpp.dispatcher.Dispatcher.send
spade.xmpp.transports.TCPsocket.send
spade.xmppd.xmppd.RPC_Client.send
spade.xmppd.xmppd.Session.send" class="py-name" href="#" onclick="return doclink('link-48', 'send', 'link-25');">send</a></tt><tt class="py-op">(</tt><tt id="link-49" class="py-name"><a title="spade.xmpp.simplexml.Node" class="py-name" href="#" onclick="return doclink('link-49', 'Node', 'link-26');">Node</a></tt><tt class="py-op">(</tt><tt class="py-string">'proceed'</tt><tt class="py-op">,</tt><tt class="py-op">{</tt><tt class="py-string">'xmlns'</tt><tt class="py-op">:</tt><tt id="link-50" class="py-name"><a title="spade.Agent.NS_TLS
spade.MTP.NS_TLS
spade.Organization.NS_TLS
spade.Organization_new.NS_TLS
spade.Unit.NS_TLS
spade.Unit_new.NS_TLS
spade.pubsub.NS_TLS
spade.socialnetwork.NS_TLS
spade.xmpp.NS_TLS
spade.xmpp.auth.NS_TLS
spade.xmpp.browser.NS_TLS
spade.xmpp.commands.NS_TLS
spade.xmpp.dispatcher.NS_TLS
spade.xmpp.features.NS_TLS
spade.xmpp.filetransfer.NS_TLS
spade.xmpp.protocol.NS_TLS
spade.xmpp.roster.NS_TLS
spade.xmpp.transports.NS_TLS
spade.xmppd.modules.config.NS_TLS
spade.xmppd.modules.db_fake.NS_TLS
spade.xmppd.modules.dialback.NS_TLS
spade.xmppd.modules.jep0077.NS_TLS
spade.xmppd.modules.jep0078.NS_TLS
spade.xmppd.modules.message.NS_TLS
spade.xmppd.modules.muc.NS_TLS
spade.xmppd.modules.oob.NS_TLS
spade.xmppd.modules.pubsub.NS_TLS
spade.xmppd.modules.roster.NS_TLS
spade.xmppd.modules.router.NS_TLS
spade.xmppd.modules.stream.NS_TLS
spade.xmppd.modules.webadmin.NS_TLS
spade.xmppd.modules.wq.NS_TLS
spade.xmppd.xmppd.NS_TLS" class="py-name" href="#" onclick="return doclink('link-50', 'NS_TLS', 'link-5');">NS_TLS</a></tt><tt class="py-op">}</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-51" class="py-name" targets="Method spade.xmppd.modules.stream.TLS.startservertls()=spade.xmppd.modules.stream.TLS-class.html#startservertls"><a title="spade.xmppd.modules.stream.TLS.startservertls" class="py-name" href="#" onclick="return doclink('link-51', 'startservertls', 'link-51');">startservertls</a></tt><tt class="py-op">(</tt><tt id="link-52" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-52', 'session', 'link-22');">session</a></tt><tt class="py-op">)</tt> </tt>
<a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line">        <tt class="py-keyword">raise</tt> <tt id="link-53" class="py-name"><a title="spade.xmpp.protocol.NodeProcessed" class="py-name" href="#" onclick="return doclink('link-53', 'NodeProcessed', 'link-32');">NodeProcessed</a></tt> </tt>
</div><a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line"> </tt>
<a name="TLS.startservertls"></a><div id="TLS.startservertls-def"><a name="L52"></a><tt class="py-lineno"> 52</tt> <a class="py-toggle" href="#" id="TLS.startservertls-toggle" onclick="return toggle('TLS.startservertls');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="spade.xmppd.modules.stream.TLS-class.html#startservertls">startservertls</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">session</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="TLS.startservertls-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="TLS.startservertls-expanded"><a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line">        <tt id="link-54" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-54', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt id="link-55" class="py-name" targets="Method spade.xmppd.xmppd.Server.unregistersession()=spade.xmppd.xmppd.Server-class.html#unregistersession,Method spade.xmppd.xmppd.multisession_manager.multisession_thread.unregistersession()=spade.xmppd.xmppd.multisession_manager.multisession_thread-class.html#unregistersession,Method spade.xmppd.xmppd.multisession_manager.unregistersession()=spade.xmppd.xmppd.multisession_manager-class.html#unregistersession"><a title="spade.xmppd.xmppd.Server.unregistersession
spade.xmppd.xmppd.multisession_manager.multisession_thread.unregistersession
spade.xmppd.xmppd.multisession_manager.unregistersession" class="py-name" href="#" onclick="return doclink('link-55', 'unregistersession', 'link-55');">unregistersession</a></tt><tt class="py-op">(</tt><tt id="link-56" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-56', 'session', 'link-22');">session</a></tt><tt class="py-op">)</tt> </tt>
<a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-57" class="py-name" targets="Method spade.xmppd.modules.stream.TLS._startservertls()=spade.xmppd.modules.stream.TLS-class.html#_startservertls"><a title="spade.xmppd.modules.stream.TLS._startservertls" class="py-name" href="#" onclick="return doclink('link-57', '_startservertls', 'link-57');">_startservertls</a></tt><tt class="py-op">(</tt><tt id="link-58" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-58', 'session', 'link-22');">session</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line"> </tt>
<a name="TLS._startservertls"></a><div id="TLS._startservertls-def"><a name="L56"></a><tt class="py-lineno"> 56</tt> <a class="py-toggle" href="#" id="TLS._startservertls-toggle" onclick="return toggle('TLS._startservertls');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="spade.xmppd.modules.stream.TLS-class.html#_startservertls">_startservertls</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">session</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="TLS._startservertls-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="TLS._startservertls-expanded"><a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line">            <tt class="py-name">cert</tt><tt class="py-op">=</tt><tt id="link-59" class="py-name"><a title="spade.dblite.Base.open" class="py-name" href="#" onclick="return doclink('link-59', 'open', 'link-34');">open</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt class="py-name">sslcertfile</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line">            <tt class="py-name">key</tt><tt class="py-op">=</tt><tt id="link-60" class="py-name"><a title="spade.dblite.Base.open" class="py-name" href="#" onclick="return doclink('link-60', 'open', 'link-34');">open</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt id="link-61" class="py-name"><a title="spade.xmppd.modules.config.sslkeyfile" class="py-name" href="#" onclick="return doclink('link-61', 'sslkeyfile', 'link-33');">sslkeyfile</a></tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt><tt class="py-op">:</tt> </tt>
<a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line">            <tt id="link-62" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-62', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-63" class="py-name"><a title="spade.xmpp.session.Session.unfeature
spade.xmppd.xmppd.Server.unfeature
spade.xmppd.xmppd.Session.unfeature" class="py-name" href="#" onclick="return doclink('link-63', 'unfeature', 'link-30');">unfeature</a></tt><tt class="py-op">(</tt><tt id="link-64" class="py-name"><a title="spade.Agent.NS_TLS
spade.MTP.NS_TLS
spade.Organization.NS_TLS
spade.Organization_new.NS_TLS
spade.Unit.NS_TLS
spade.Unit_new.NS_TLS
spade.pubsub.NS_TLS
spade.socialnetwork.NS_TLS
spade.xmpp.NS_TLS
spade.xmpp.auth.NS_TLS
spade.xmpp.browser.NS_TLS
spade.xmpp.commands.NS_TLS
spade.xmpp.dispatcher.NS_TLS
spade.xmpp.features.NS_TLS
spade.xmpp.filetransfer.NS_TLS
spade.xmpp.protocol.NS_TLS
spade.xmpp.roster.NS_TLS
spade.xmpp.transports.NS_TLS
spade.xmppd.modules.config.NS_TLS
spade.xmppd.modules.db_fake.NS_TLS
spade.xmppd.modules.dialback.NS_TLS
spade.xmppd.modules.jep0077.NS_TLS
spade.xmppd.modules.jep0078.NS_TLS
spade.xmppd.modules.message.NS_TLS
spade.xmppd.modules.muc.NS_TLS
spade.xmppd.modules.oob.NS_TLS
spade.xmppd.modules.pubsub.NS_TLS
spade.xmppd.modules.roster.NS_TLS
spade.xmppd.modules.router.NS_TLS
spade.xmppd.modules.stream.NS_TLS
spade.xmppd.modules.webadmin.NS_TLS
spade.xmppd.modules.wq.NS_TLS
spade.xmppd.xmppd.NS_TLS" class="py-name" href="#" onclick="return doclink('link-64', 'NS_TLS', 'link-5');">NS_TLS</a></tt><tt class="py-op">)</tt> </tt>
<a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line">            <tt id="link-65" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-65', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-66" class="py-name" targets="Method spade.xmpp.session.Session.terminate_stream()=spade.xmpp.session.Session-class.html#terminate_stream,Method spade.xmppd.xmppd.Session.terminate_stream()=spade.xmppd.xmppd.Session-class.html#terminate_stream"><a title="spade.xmpp.session.Session.terminate_stream
spade.xmppd.xmppd.Session.terminate_stream" class="py-name" href="#" onclick="return doclink('link-66', 'terminate_stream', 'link-66');">terminate_stream</a></tt><tt class="py-op">(</tt><tt id="link-67" class="py-name" targets="Variable spade.Agent.STREAM_INTERNAL_SERVER_ERROR=spade.Agent-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.MTP.STREAM_INTERNAL_SERVER_ERROR=spade.MTP-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.Organization.STREAM_INTERNAL_SERVER_ERROR=spade.Organization-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.Organization_new.STREAM_INTERNAL_SERVER_ERROR=spade.Organization_new-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.Unit.STREAM_INTERNAL_SERVER_ERROR=spade.Unit-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.Unit_new.STREAM_INTERNAL_SERVER_ERROR=spade.Unit_new-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.pubsub.STREAM_INTERNAL_SERVER_ERROR=spade.pubsub-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.socialnetwork.STREAM_INTERNAL_SERVER_ERROR=spade.socialnetwork-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmpp.STREAM_INTERNAL_SERVER_ERROR=spade.xmpp-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmpp.auth.STREAM_INTERNAL_SERVER_ERROR=spade.xmpp.auth-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmpp.browser.STREAM_INTERNAL_SERVER_ERROR=spade.xmpp.browser-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmpp.commands.STREAM_INTERNAL_SERVER_ERROR=spade.xmpp.commands-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmpp.dispatcher.STREAM_INTERNAL_SERVER_ERROR=spade.xmpp.dispatcher-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmpp.features.STREAM_INTERNAL_SERVER_ERROR=spade.xmpp.features-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmpp.filetransfer.STREAM_INTERNAL_SERVER_ERROR=spade.xmpp.filetransfer-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmpp.protocol.STREAM_INTERNAL_SERVER_ERROR=spade.xmpp.protocol-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmpp.roster.STREAM_INTERNAL_SERVER_ERROR=spade.xmpp.roster-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmpp.transports.STREAM_INTERNAL_SERVER_ERROR=spade.xmpp.transports-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmppd.modules.config.STREAM_INTERNAL_SERVER_ERROR=spade.xmppd.modules.config-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmppd.modules.db_fake.STREAM_INTERNAL_SERVER_ERROR=spade.xmppd.modules.db_fake-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmppd.modules.dialback.STREAM_INTERNAL_SERVER_ERROR=spade.xmppd.modules.dialback-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmppd.modules.jep0077.STREAM_INTERNAL_SERVER_ERROR=spade.xmppd.modules.jep0077-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmppd.modules.jep0078.STREAM_INTERNAL_SERVER_ERROR=spade.xmppd.modules.jep0078-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmppd.modules.message.STREAM_INTERNAL_SERVER_ERROR=spade.xmppd.modules.message-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmppd.modules.muc.STREAM_INTERNAL_SERVER_ERROR=spade.xmppd.modules.muc-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmppd.modules.oob.STREAM_INTERNAL_SERVER_ERROR=spade.xmppd.modules.oob-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmppd.modules.pubsub.STREAM_INTERNAL_SERVER_ERROR=spade.xmppd.modules.pubsub-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmppd.modules.roster.STREAM_INTERNAL_SERVER_ERROR=spade.xmppd.modules.roster-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmppd.modules.router.STREAM_INTERNAL_SERVER_ERROR=spade.xmppd.modules.router-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmppd.modules.stream.STREAM_INTERNAL_SERVER_ERROR=spade.xmppd.modules.stream-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmppd.modules.webadmin.STREAM_INTERNAL_SERVER_ERROR=spade.xmppd.modules.webadmin-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmppd.modules.wq.STREAM_INTERNAL_SERVER_ERROR=spade.xmppd.modules.wq-module.html#STREAM_INTERNAL_SERVER_ERROR,Variable spade.xmppd.xmppd.STREAM_INTERNAL_SERVER_ERROR=spade.xmppd.xmppd-module.html#STREAM_INTERNAL_SERVER_ERROR"><a title="spade.Agent.STREAM_INTERNAL_SERVER_ERROR
spade.MTP.STREAM_INTERNAL_SERVER_ERROR
spade.Organization.STREAM_INTERNAL_SERVER_ERROR
spade.Organization_new.STREAM_INTERNAL_SERVER_ERROR
spade.Unit.STREAM_INTERNAL_SERVER_ERROR
spade.Unit_new.STREAM_INTERNAL_SERVER_ERROR
spade.pubsub.STREAM_INTERNAL_SERVER_ERROR
spade.socialnetwork.STREAM_INTERNAL_SERVER_ERROR
spade.xmpp.STREAM_INTERNAL_SERVER_ERROR
spade.xmpp.auth.STREAM_INTERNAL_SERVER_ERROR
spade.xmpp.browser.STREAM_INTERNAL_SERVER_ERROR
spade.xmpp.commands.STREAM_INTERNAL_SERVER_ERROR
spade.xmpp.dispatcher.STREAM_INTERNAL_SERVER_ERROR
spade.xmpp.features.STREAM_INTERNAL_SERVER_ERROR
spade.xmpp.filetransfer.STREAM_INTERNAL_SERVER_ERROR
spade.xmpp.protocol.STREAM_INTERNAL_SERVER_ERROR
spade.xmpp.roster.STREAM_INTERNAL_SERVER_ERROR
spade.xmpp.transports.STREAM_INTERNAL_SERVER_ERROR
spade.xmppd.modules.config.STREAM_INTERNAL_SERVER_ERROR
spade.xmppd.modules.db_fake.STREAM_INTERNAL_SERVER_ERROR
spade.xmppd.modules.dialback.STREAM_INTERNAL_SERVER_ERROR
spade.xmppd.modules.jep0077.STREAM_INTERNAL_SERVER_ERROR
spade.xmppd.modules.jep0078.STREAM_INTERNAL_SERVER_ERROR
spade.xmppd.modules.message.STREAM_INTERNAL_SERVER_ERROR
spade.xmppd.modules.muc.STREAM_INTERNAL_SERVER_ERROR
spade.xmppd.modules.oob.STREAM_INTERNAL_SERVER_ERROR
spade.xmppd.modules.pubsub.STREAM_INTERNAL_SERVER_ERROR
spade.xmppd.modules.roster.STREAM_INTERNAL_SERVER_ERROR
spade.xmppd.modules.router.STREAM_INTERNAL_SERVER_ERROR
spade.xmppd.modules.stream.STREAM_INTERNAL_SERVER_ERROR
spade.xmppd.modules.webadmin.STREAM_INTERNAL_SERVER_ERROR
spade.xmppd.modules.wq.STREAM_INTERNAL_SERVER_ERROR
spade.xmppd.xmppd.STREAM_INTERNAL_SERVER_ERROR" class="py-name" href="#" onclick="return doclink('link-67', 'STREAM_INTERNAL_SERVER_ERROR', 'link-67');">STREAM_INTERNAL_SERVER_ERROR</a></tt><tt class="py-op">)</tt> </tt>
<a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> </tt>
<a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line"> </tt>
<a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line">        <tt class="py-name">x509</tt> <tt class="py-op">=</tt> <tt class="py-name">X509</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line">        <tt class="py-name">x509</tt><tt class="py-op">.</tt><tt id="link-68" class="py-name" targets="Method spade.ACLParser.ACLParser.parse()=spade.ACLParser.ACLParser-class.html#parse,Method spade.ACLParser.ACLxmlParser.parse()=spade.ACLParser.ACLxmlParser-class.html#parse,Method spade.RDF0Parser.RDF0Parser.parse()=spade.RDF0Parser.RDF0Parser-class.html#parse,Method spade.SL0Parser.SL0Parser.parse()=spade.SL0Parser.SL0Parser-class.html#parse,Method spade.SpadeConfigParser.ConfigParser.parse()=spade.SpadeConfigParser.ConfigParser-class.html#parse,Method spade.XMLCodec.XMLCodec.parse()=spade.XMLCodec.XMLCodec-class.html#parse,Method spade.pygooglechart.ChartGrammar.parse()=spade.pygooglechart.ChartGrammar-class.html#parse,Method spade.pyparsing.ParserElement.parse()=spade.pyparsing.ParserElement-class.html#parse,Method spade.pyratemp.Parser.parse()=spade.pyratemp.Parser-class.html#parse"><a title="spade.ACLParser.ACLParser.parse
spade.ACLParser.ACLxmlParser.parse
spade.RDF0Parser.RDF0Parser.parse
spade.SL0Parser.SL0Parser.parse
spade.SpadeConfigParser.ConfigParser.parse
spade.XMLCodec.XMLCodec.parse
spade.pygooglechart.ChartGrammar.parse
spade.pyparsing.ParserElement.parse
spade.pyratemp.Parser.parse" class="py-name" href="#" onclick="return doclink('link-68', 'parse', 'link-68');">parse</a></tt><tt class="py-op">(</tt><tt class="py-name">cert</tt><tt class="py-op">)</tt> </tt>
<a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line">        <tt class="py-name">certChain</tt> <tt class="py-op">=</tt> <tt class="py-name">X509CertChain</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">x509</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line">        <tt class="py-name">privateKey</tt> <tt class="py-op">=</tt> <tt class="py-name">parsePEMKey</tt><tt class="py-op">(</tt><tt class="py-name">key</tt><tt class="py-op">,</tt> <tt class="py-name">private</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
<a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line">        <tt class="py-name">connection</tt> <tt class="py-op">=</tt> <tt class="py-name">TLSConnection</tt><tt class="py-op">(</tt><tt id="link-69" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-69', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">_sock</tt><tt class="py-op">)</tt> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> <tt class="py-name">connection</tt><tt class="py-op">.</tt><tt class="py-name">handshakeServer</tt><tt class="py-op">(</tt><tt class="py-name">certChain</tt><tt class="py-op">=</tt><tt class="py-name">certChain</tt><tt class="py-op">,</tt> <tt class="py-name">privateKey</tt><tt class="py-op">=</tt><tt class="py-name">privateKey</tt><tt class="py-op">,</tt> <tt class="py-name">reqCert</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt><tt class="py-op">:</tt> </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line">            <tt id="link-70" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-70', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-71" class="py-name"><a title="spade.xmpp.session.Session.terminate_stream
spade.xmppd.xmppd.Session.terminate_stream" class="py-name" href="#" onclick="return doclink('link-71', 'terminate_stream', 'link-66');">terminate_stream</a></tt><tt class="py-op">(</tt><tt id="link-72" class="py-name" targets="Function spade.xmpp.features.unregister()=spade.xmpp.features-module.html#unregister,Method spade.xmppd.xmppd.fake_select.poll.unregister()=spade.xmppd.xmppd.fake_select.poll-class.html#unregister"><a title="spade.xmpp.features.unregister
spade.xmppd.xmppd.fake_select.poll.unregister" class="py-name" href="#" onclick="return doclink('link-72', 'unregister', 'link-72');">unregister</a></tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> </tt>
<a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line"> </tt>
<a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line">        <tt id="link-73" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-73', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">_sslObj</tt> <tt class="py-op">=</tt> <tt class="py-name">connection</tt> </tt>
<a name="L76"></a><tt class="py-lineno"> 76</tt>  <tt class="py-line">        <tt id="link-74" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-74', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">_recv</tt> <tt class="py-op">=</tt> <tt class="py-name">connection</tt><tt class="py-op">.</tt><tt class="py-name">read</tt> </tt>
<a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line">        <tt id="link-75" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-75', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">_send</tt> <tt class="py-op">=</tt> <tt class="py-name">connection</tt><tt class="py-op">.</tt><tt id="link-76" class="py-name"><a title="spade.Agent.AbstractAgent.send
spade.MTP.MTP.send
spade.xmpp.dispatcher.Dispatcher.send
spade.xmpp.transports.TCPsocket.send
spade.xmppd.xmppd.RPC_Client.send
spade.xmppd.xmppd.Session.send" class="py-name" href="#" onclick="return doclink('link-76', 'send', 'link-25');">send</a></tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line"> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line">        <tt id="link-77" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-77', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-78" class="py-name" targets="Method spade.xmpp.session.Session.feature()=spade.xmpp.session.Session-class.html#feature,Method spade.xmppd.xmppd.Server.feature()=spade.xmppd.xmppd.Server-class.html#feature,Method spade.xmppd.xmppd.Session.feature()=spade.xmppd.xmppd.Session-class.html#feature"><a title="spade.xmpp.session.Session.feature
spade.xmppd.xmppd.Server.feature
spade.xmppd.xmppd.Session.feature" class="py-name" href="#" onclick="return doclink('link-78', 'feature', 'link-78');">feature</a></tt><tt class="py-op">(</tt><tt id="link-79" class="py-name"><a title="spade.Agent.NS_TLS
spade.MTP.NS_TLS
spade.Organization.NS_TLS
spade.Organization_new.NS_TLS
spade.Unit.NS_TLS
spade.Unit_new.NS_TLS
spade.pubsub.NS_TLS
spade.socialnetwork.NS_TLS
spade.xmpp.NS_TLS
spade.xmpp.auth.NS_TLS
spade.xmpp.browser.NS_TLS
spade.xmpp.commands.NS_TLS
spade.xmpp.dispatcher.NS_TLS
spade.xmpp.features.NS_TLS
spade.xmpp.filetransfer.NS_TLS
spade.xmpp.protocol.NS_TLS
spade.xmpp.roster.NS_TLS
spade.xmpp.transports.NS_TLS
spade.xmppd.modules.config.NS_TLS
spade.xmppd.modules.db_fake.NS_TLS
spade.xmppd.modules.dialback.NS_TLS
spade.xmppd.modules.jep0077.NS_TLS
spade.xmppd.modules.jep0078.NS_TLS
spade.xmppd.modules.message.NS_TLS
spade.xmppd.modules.muc.NS_TLS
spade.xmppd.modules.oob.NS_TLS
spade.xmppd.modules.pubsub.NS_TLS
spade.xmppd.modules.roster.NS_TLS
spade.xmppd.modules.router.NS_TLS
spade.xmppd.modules.stream.NS_TLS
spade.xmppd.modules.webadmin.NS_TLS
spade.xmppd.modules.wq.NS_TLS
spade.xmppd.xmppd.NS_TLS" class="py-name" href="#" onclick="return doclink('link-79', 'NS_TLS', 'link-5');">NS_TLS</a></tt><tt class="py-op">)</tt>      <tt class="py-comment"># TLS enabled, do not declare it anymore</tt> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line">        <tt id="link-80" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-80', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-81" class="py-name"><a title="spade.xmpp.session.Session.stop_feature
spade.xmppd.xmppd.Session.stop_feature" class="py-name" href="#" onclick="return doclink('link-81', 'stop_feature', 'link-45');">stop_feature</a></tt><tt class="py-op">(</tt><tt id="link-82" class="py-name"><a title="spade.Agent.NS_TLS
spade.MTP.NS_TLS
spade.Organization.NS_TLS
spade.Organization_new.NS_TLS
spade.Unit.NS_TLS
spade.Unit_new.NS_TLS
spade.pubsub.NS_TLS
spade.socialnetwork.NS_TLS
spade.xmpp.NS_TLS
spade.xmpp.auth.NS_TLS
spade.xmpp.browser.NS_TLS
spade.xmpp.commands.NS_TLS
spade.xmpp.dispatcher.NS_TLS
spade.xmpp.features.NS_TLS
spade.xmpp.filetransfer.NS_TLS
spade.xmpp.protocol.NS_TLS
spade.xmpp.roster.NS_TLS
spade.xmpp.transports.NS_TLS
spade.xmppd.modules.config.NS_TLS
spade.xmppd.modules.db_fake.NS_TLS
spade.xmppd.modules.dialback.NS_TLS
spade.xmppd.modules.jep0077.NS_TLS
spade.xmppd.modules.jep0078.NS_TLS
spade.xmppd.modules.message.NS_TLS
spade.xmppd.modules.muc.NS_TLS
spade.xmppd.modules.oob.NS_TLS
spade.xmppd.modules.pubsub.NS_TLS
spade.xmppd.modules.roster.NS_TLS
spade.xmppd.modules.router.NS_TLS
spade.xmppd.modules.stream.NS_TLS
spade.xmppd.modules.webadmin.NS_TLS
spade.xmppd.modules.wq.NS_TLS
spade.xmppd.xmppd.NS_TLS" class="py-name" href="#" onclick="return doclink('link-82', 'NS_TLS', 'link-5');">NS_TLS</a></tt><tt class="py-op">)</tt> <tt class="py-comment"># TLS finished, let another features start</tt> </tt>
<a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line">        <tt id="link-83" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-83', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-84" class="py-name" targets="Method spade.xmpp.session.Session.StartStream()=spade.xmpp.session.Session-class.html#StartStream,Method spade.xmppd.xmppd.Session.StartStream()=spade.xmppd.xmppd.Session-class.html#StartStream"><a title="spade.xmpp.session.Session.StartStream
spade.xmppd.xmppd.Session.StartStream" class="py-name" href="#" onclick="return doclink('link-84', 'StartStream', 'link-84');">StartStream</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line">        <tt id="link-85" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-85', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt id="link-86" class="py-name" targets="Method spade.xmppd.xmppd.Server.registersession()=spade.xmppd.xmppd.Server-class.html#registersession,Method spade.xmppd.xmppd.multisession_manager.multisession_thread.registersession()=spade.xmppd.xmppd.multisession_manager.multisession_thread-class.html#registersession,Method spade.xmppd.xmppd.multisession_manager.registersession()=spade.xmppd.xmppd.multisession_manager-class.html#registersession"><a title="spade.xmppd.xmppd.Server.registersession
spade.xmppd.xmppd.multisession_manager.multisession_thread.registersession
spade.xmppd.xmppd.multisession_manager.registersession" class="py-name" href="#" onclick="return doclink('link-86', 'registersession', 'link-86');">registersession</a></tt><tt class="py-op">(</tt><tt id="link-87" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-87', 'session', 'link-22');">session</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line"> </tt>
<a name="TLS.proceedfailureHandler"></a><div id="TLS.proceedfailureHandler-def"><a name="L84"></a><tt class="py-lineno"> 84</tt> <a class="py-toggle" href="#" id="TLS.proceedfailureHandler-toggle" onclick="return toggle('TLS.proceedfailureHandler');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="spade.xmppd.modules.stream.TLS-class.html#proceedfailureHandler">proceedfailureHandler</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">session</tt><tt class="py-op">,</tt><tt class="py-param">stanza</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="TLS.proceedfailureHandler-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="TLS.proceedfailureHandler-expanded"><a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">stanza</tt><tt class="py-op">.</tt><tt id="link-88" class="py-name" targets="Method spade.AID.aid.getName()=spade.AID.aid-class.html#getName,Method spade.Agent.AbstractAgent.getName()=spade.Agent.AbstractAgent-class.html#getName,Method spade.DF.DfAgentDescription.getName()=spade.DF.DfAgentDescription-class.html#getName,Method spade.DF.Service.getName()=spade.DF.Service-class.html#getName,Method spade.DF.ServiceDescription.getName()=spade.DF.ServiceDescription-class.html#getName,Method spade.pyparsing.ParseResults.getName()=spade.pyparsing.ParseResults-class.html#getName,Method spade.xmpp.roster.Roster.getName()=spade.xmpp.roster.Roster-class.html#getName,Method spade.xmpp.simplexml.Node.getName()=spade.xmpp.simplexml.Node-class.html#getName,Method spade.xmppd.modules.muc.Room.getName()=spade.xmppd.modules.muc.Room-class.html#getName,Method spade.xmppd.modules.wq.Group.getName()=spade.xmppd.modules.wq.Group-class.html#getName,Method spade.xmppd.xmppd.Session.getName()=spade.xmppd.xmppd.Session-class.html#getName"><a title="spade.AID.aid.getName
spade.Agent.AbstractAgent.getName
spade.DF.DfAgentDescription.getName
spade.DF.Service.getName
spade.DF.ServiceDescription.getName
spade.pyparsing.ParseResults.getName
spade.xmpp.roster.Roster.getName
spade.xmpp.simplexml.Node.getName
spade.xmppd.modules.muc.Room.getName
spade.xmppd.modules.wq.Group.getName
spade.xmppd.xmppd.Session.getName" class="py-name" href="#" onclick="return doclink('link-88', 'getName', 'link-88');">getName</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">&lt;&gt;</tt><tt class="py-string">'proceed'</tt><tt class="py-op">:</tt> </tt>
<a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-89" class="py-name"><a title="spade.Agent.AbstractAgent.DEBUG
spade.spade_backend.SpadeBackend.DEBUG
spade.xmpp.client.PlugIn.DEBUG
spade.xmpp.simplexml.NodeBuilder.DEBUG
spade.xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-89', 'DEBUG', 'link-28');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">'TLS can not be started. Giving up.'</tt><tt class="py-op">,</tt><tt class="py-string">'error'</tt><tt class="py-op">)</tt> </tt>
<a name="L87"></a><tt class="py-lineno"> 87</tt>  <tt class="py-line">            <tt id="link-90" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-90', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-91" class="py-name"><a title="spade.xmpp.session.Session.unfeature
spade.xmppd.xmppd.Server.unfeature
spade.xmppd.xmppd.Session.unfeature" class="py-name" href="#" onclick="return doclink('link-91', 'unfeature', 'link-30');">unfeature</a></tt><tt class="py-op">(</tt><tt id="link-92" class="py-name"><a title="spade.Agent.NS_TLS
spade.MTP.NS_TLS
spade.Organization.NS_TLS
spade.Organization_new.NS_TLS
spade.Unit.NS_TLS
spade.Unit_new.NS_TLS
spade.pubsub.NS_TLS
spade.socialnetwork.NS_TLS
spade.xmpp.NS_TLS
spade.xmpp.auth.NS_TLS
spade.xmpp.browser.NS_TLS
spade.xmpp.commands.NS_TLS
spade.xmpp.dispatcher.NS_TLS
spade.xmpp.features.NS_TLS
spade.xmpp.filetransfer.NS_TLS
spade.xmpp.protocol.NS_TLS
spade.xmpp.roster.NS_TLS
spade.xmpp.transports.NS_TLS
spade.xmppd.modules.config.NS_TLS
spade.xmppd.modules.db_fake.NS_TLS
spade.xmppd.modules.dialback.NS_TLS
spade.xmppd.modules.jep0077.NS_TLS
spade.xmppd.modules.jep0078.NS_TLS
spade.xmppd.modules.message.NS_TLS
spade.xmppd.modules.muc.NS_TLS
spade.xmppd.modules.oob.NS_TLS
spade.xmppd.modules.pubsub.NS_TLS
spade.xmppd.modules.roster.NS_TLS
spade.xmppd.modules.router.NS_TLS
spade.xmppd.modules.stream.NS_TLS
spade.xmppd.modules.webadmin.NS_TLS
spade.xmppd.modules.wq.NS_TLS
spade.xmppd.xmppd.NS_TLS" class="py-name" href="#" onclick="return doclink('link-92', 'NS_TLS', 'link-5');">NS_TLS</a></tt><tt class="py-op">)</tt> </tt>
<a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt id="link-93" class="py-name"><a title="spade.xmpp.protocol.NodeProcessed" class="py-name" href="#" onclick="return doclink('link-93', 'NodeProcessed', 'link-32');">NodeProcessed</a></tt> </tt>
<a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-94" class="py-name"><a title="spade.Agent.AbstractAgent.DEBUG
spade.spade_backend.SpadeBackend.DEBUG
spade.xmpp.client.PlugIn.DEBUG
spade.xmpp.simplexml.NodeBuilder.DEBUG
spade.xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-94', 'DEBUG', 'link-28');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">'Starting client-mode TLS.'</tt><tt class="py-op">,</tt><tt class="py-string">'ok'</tt><tt class="py-op">)</tt> </tt>
<a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> <tt id="link-95" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-95', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">_sslObj</tt> <tt class="py-op">=</tt> <tt class="py-name">socket</tt><tt class="py-op">.</tt><tt class="py-name">ssl</tt><tt class="py-op">(</tt><tt id="link-96" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-96', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">_sock</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
<a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt><tt class="py-op">:</tt> </tt>
<a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line">            <tt id="link-97" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-97', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-98" class="py-name" targets="Method spade.xmpp.session.Session.set_socket_state()=spade.xmpp.session.Session-class.html#set_socket_state,Method spade.xmppd.xmppd.Session.set_socket_state()=spade.xmppd.xmppd.Session-class.html#set_socket_state"><a title="spade.xmpp.session.Session.set_socket_state
spade.xmppd.xmppd.Session.set_socket_state" class="py-name" href="#" onclick="return doclink('link-98', 'set_socket_state', 'link-98');">set_socket_state</a></tt><tt class="py-op">(</tt><tt id="link-99" class="py-name" targets="Variable spade.xmpp.session.SOCKET_DEAD=spade.xmpp.session-module.html#SOCKET_DEAD,Variable spade.xmppd.modules.stream.SOCKET_DEAD=spade.xmppd.modules.stream-module.html#SOCKET_DEAD,Variable spade.xmppd.xmppd.SOCKET_DEAD=spade.xmppd.xmppd-module.html#SOCKET_DEAD"><a title="spade.xmpp.session.SOCKET_DEAD
spade.xmppd.modules.stream.SOCKET_DEAD
spade.xmppd.xmppd.SOCKET_DEAD" class="py-name" href="#" onclick="return doclink('link-99', 'SOCKET_DEAD', 'link-99');">SOCKET_DEAD</a></tt><tt class="py-op">)</tt> </tt>
<a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-100" class="py-name"><a title="spade.Agent.AbstractAgent.DEBUG
spade.spade_backend.SpadeBackend.DEBUG
spade.xmpp.client.PlugIn.DEBUG
spade.xmpp.simplexml.NodeBuilder.DEBUG
spade.xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-100', 'DEBUG', 'link-28');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">'TLS failed. Terminating session'</tt><tt class="py-op">,</tt><tt class="py-string">'error'</tt><tt class="py-op">)</tt> </tt>
<a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line">            <tt id="link-101" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-101', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-102" class="py-name"><a title="spade.xmpp.session.Session.terminate_stream
spade.xmppd.xmppd.Session.terminate_stream" class="py-name" href="#" onclick="return doclink('link-102', 'terminate_stream', 'link-66');">terminate_stream</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt id="link-103" class="py-name"><a title="spade.xmpp.protocol.NodeProcessed" class="py-name" href="#" onclick="return doclink('link-103', 'NodeProcessed', 'link-32');">NodeProcessed</a></tt> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line">        <tt id="link-104" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-104', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">_recv</tt> <tt class="py-op">=</tt> <tt id="link-105" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-105', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">_sslObj</tt><tt class="py-op">.</tt><tt class="py-name">read</tt> </tt>
<a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line">        <tt id="link-106" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-106', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">_send</tt> <tt class="py-op">=</tt> <tt id="link-107" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-107', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">_sslObj</tt><tt class="py-op">.</tt><tt class="py-name">write</tt> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line"> </tt>
<a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line">        <tt id="link-108" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-108', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-109" class="py-name"><a title="spade.xmpp.session.Session.feature
spade.xmppd.xmppd.Server.feature
spade.xmppd.xmppd.Session.feature" class="py-name" href="#" onclick="return doclink('link-109', 'feature', 'link-78');">feature</a></tt><tt class="py-op">(</tt><tt id="link-110" class="py-name"><a title="spade.Agent.NS_TLS
spade.MTP.NS_TLS
spade.Organization.NS_TLS
spade.Organization_new.NS_TLS
spade.Unit.NS_TLS
spade.Unit_new.NS_TLS
spade.pubsub.NS_TLS
spade.socialnetwork.NS_TLS
spade.xmpp.NS_TLS
spade.xmpp.auth.NS_TLS
spade.xmpp.browser.NS_TLS
spade.xmpp.commands.NS_TLS
spade.xmpp.dispatcher.NS_TLS
spade.xmpp.features.NS_TLS
spade.xmpp.filetransfer.NS_TLS
spade.xmpp.protocol.NS_TLS
spade.xmpp.roster.NS_TLS
spade.xmpp.transports.NS_TLS
spade.xmppd.modules.config.NS_TLS
spade.xmppd.modules.db_fake.NS_TLS
spade.xmppd.modules.dialback.NS_TLS
spade.xmppd.modules.jep0077.NS_TLS
spade.xmppd.modules.jep0078.NS_TLS
spade.xmppd.modules.message.NS_TLS
spade.xmppd.modules.muc.NS_TLS
spade.xmppd.modules.oob.NS_TLS
spade.xmppd.modules.pubsub.NS_TLS
spade.xmppd.modules.roster.NS_TLS
spade.xmppd.modules.router.NS_TLS
spade.xmppd.modules.stream.NS_TLS
spade.xmppd.modules.webadmin.NS_TLS
spade.xmppd.modules.wq.NS_TLS
spade.xmppd.xmppd.NS_TLS" class="py-name" href="#" onclick="return doclink('link-110', 'NS_TLS', 'link-5');">NS_TLS</a></tt><tt class="py-op">)</tt>      <tt class="py-comment"># TLS enabled, do not declare it anymore</tt> </tt>
<a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line">        <tt id="link-111" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-111', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-112" class="py-name"><a title="spade.xmpp.session.Session.stop_feature
spade.xmppd.xmppd.Session.stop_feature" class="py-name" href="#" onclick="return doclink('link-112', 'stop_feature', 'link-45');">stop_feature</a></tt><tt class="py-op">(</tt><tt id="link-113" class="py-name"><a title="spade.Agent.NS_TLS
spade.MTP.NS_TLS
spade.Organization.NS_TLS
spade.Organization_new.NS_TLS
spade.Unit.NS_TLS
spade.Unit_new.NS_TLS
spade.pubsub.NS_TLS
spade.socialnetwork.NS_TLS
spade.xmpp.NS_TLS
spade.xmpp.auth.NS_TLS
spade.xmpp.browser.NS_TLS
spade.xmpp.commands.NS_TLS
spade.xmpp.dispatcher.NS_TLS
spade.xmpp.features.NS_TLS
spade.xmpp.filetransfer.NS_TLS
spade.xmpp.protocol.NS_TLS
spade.xmpp.roster.NS_TLS
spade.xmpp.transports.NS_TLS
spade.xmppd.modules.config.NS_TLS
spade.xmppd.modules.db_fake.NS_TLS
spade.xmppd.modules.dialback.NS_TLS
spade.xmppd.modules.jep0077.NS_TLS
spade.xmppd.modules.jep0078.NS_TLS
spade.xmppd.modules.message.NS_TLS
spade.xmppd.modules.muc.NS_TLS
spade.xmppd.modules.oob.NS_TLS
spade.xmppd.modules.pubsub.NS_TLS
spade.xmppd.modules.roster.NS_TLS
spade.xmppd.modules.router.NS_TLS
spade.xmppd.modules.stream.NS_TLS
spade.xmppd.modules.webadmin.NS_TLS
spade.xmppd.modules.wq.NS_TLS
spade.xmppd.xmppd.NS_TLS" class="py-name" href="#" onclick="return doclink('link-113', 'NS_TLS', 'link-5');">NS_TLS</a></tt><tt class="py-op">)</tt> <tt class="py-comment"># TLS finished, let another features start</tt> </tt>
<a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line">        <tt id="link-114" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-114', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-115" class="py-name"><a title="spade.xmpp.session.Session.StartStream
spade.xmppd.xmppd.Session.StartStream" class="py-name" href="#" onclick="return doclink('link-115', 'StartStream', 'link-84');">StartStream</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line">        <tt class="py-keyword">raise</tt> <tt id="link-116" class="py-name"><a title="spade.xmpp.protocol.NodeProcessed" class="py-name" href="#" onclick="return doclink('link-116', 'NodeProcessed', 'link-32');">NodeProcessed</a></tt> </tt>
</div><a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line"> </tt>
<a name="TLS.FeaturesHandler"></a><div id="TLS.FeaturesHandler-def"><a name="L104"></a><tt class="py-lineno">104</tt> <a class="py-toggle" href="#" id="TLS.FeaturesHandler-toggle" onclick="return toggle('TLS.FeaturesHandler');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="spade.xmppd.modules.stream.TLS-class.html#FeaturesHandler">FeaturesHandler</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">session</tt><tt class="py-op">,</tt><tt class="py-param">stanza</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="TLS.FeaturesHandler-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="TLS.FeaturesHandler-expanded"><a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-117" class="py-name"><a title="spade.Agent.NS_TLS
spade.MTP.NS_TLS
spade.Organization.NS_TLS
spade.Organization_new.NS_TLS
spade.Unit.NS_TLS
spade.Unit_new.NS_TLS
spade.pubsub.NS_TLS
spade.socialnetwork.NS_TLS
spade.xmpp.NS_TLS
spade.xmpp.auth.NS_TLS
spade.xmpp.browser.NS_TLS
spade.xmpp.commands.NS_TLS
spade.xmpp.dispatcher.NS_TLS
spade.xmpp.features.NS_TLS
spade.xmpp.filetransfer.NS_TLS
spade.xmpp.protocol.NS_TLS
spade.xmpp.roster.NS_TLS
spade.xmpp.transports.NS_TLS
spade.xmppd.modules.config.NS_TLS
spade.xmppd.modules.db_fake.NS_TLS
spade.xmppd.modules.dialback.NS_TLS
spade.xmppd.modules.jep0077.NS_TLS
spade.xmppd.modules.jep0078.NS_TLS
spade.xmppd.modules.message.NS_TLS
spade.xmppd.modules.muc.NS_TLS
spade.xmppd.modules.oob.NS_TLS
spade.xmppd.modules.pubsub.NS_TLS
spade.xmppd.modules.roster.NS_TLS
spade.xmppd.modules.router.NS_TLS
spade.xmppd.modules.stream.NS_TLS
spade.xmppd.modules.webadmin.NS_TLS
spade.xmppd.modules.wq.NS_TLS
spade.xmppd.xmppd.NS_TLS" class="py-name" href="#" onclick="return doclink('link-117', 'NS_TLS', 'link-5');">NS_TLS</a></tt> <tt class="py-keyword">in</tt> <tt id="link-118" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-118', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-119" class="py-name"><a title="spade.xmpp.features" class="py-name" href="#" onclick="return doclink('link-119', 'features', 'link-23');">features</a></tt><tt class="py-op">:</tt> <tt class="py-keyword">return</tt>     <tt class="py-comment"># already started. do nothing</tt> </tt>
<a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-120" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-120', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">feature_in_process</tt><tt class="py-op">:</tt> <tt class="py-keyword">return</tt>     <tt class="py-comment"># some other feature is already underway</tt> </tt>
<a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">stanza</tt><tt class="py-op">.</tt><tt id="link-121" class="py-name" targets="Method spade.xmpp.simplexml.Node.getTag()=spade.xmpp.simplexml.Node-class.html#getTag"><a title="spade.xmpp.simplexml.Node.getTag" class="py-name" href="#" onclick="return doclink('link-121', 'getTag', 'link-121');">getTag</a></tt><tt class="py-op">(</tt><tt class="py-string">'starttls'</tt><tt class="py-op">,</tt><tt class="py-name">namespace</tt><tt class="py-op">=</tt><tt id="link-122" class="py-name"><a title="spade.Agent.NS_TLS
spade.MTP.NS_TLS
spade.Organization.NS_TLS
spade.Organization_new.NS_TLS
spade.Unit.NS_TLS
spade.Unit_new.NS_TLS
spade.pubsub.NS_TLS
spade.socialnetwork.NS_TLS
spade.xmpp.NS_TLS
spade.xmpp.auth.NS_TLS
spade.xmpp.browser.NS_TLS
spade.xmpp.commands.NS_TLS
spade.xmpp.dispatcher.NS_TLS
spade.xmpp.features.NS_TLS
spade.xmpp.filetransfer.NS_TLS
spade.xmpp.protocol.NS_TLS
spade.xmpp.roster.NS_TLS
spade.xmpp.transports.NS_TLS
spade.xmppd.modules.config.NS_TLS
spade.xmppd.modules.db_fake.NS_TLS
spade.xmppd.modules.dialback.NS_TLS
spade.xmppd.modules.jep0077.NS_TLS
spade.xmppd.modules.jep0078.NS_TLS
spade.xmppd.modules.message.NS_TLS
spade.xmppd.modules.muc.NS_TLS
spade.xmppd.modules.oob.NS_TLS
spade.xmppd.modules.pubsub.NS_TLS
spade.xmppd.modules.roster.NS_TLS
spade.xmppd.modules.router.NS_TLS
spade.xmppd.modules.stream.NS_TLS
spade.xmppd.modules.webadmin.NS_TLS
spade.xmppd.modules.wq.NS_TLS
spade.xmppd.xmppd.NS_TLS" class="py-name" href="#" onclick="return doclink('link-122', 'NS_TLS', 'link-5');">NS_TLS</a></tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L108"></a><tt class="py-lineno">108</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-123" class="py-name"><a title="spade.Agent.AbstractAgent.DEBUG
spade.spade_backend.SpadeBackend.DEBUG
spade.xmpp.client.PlugIn.DEBUG
spade.xmpp.simplexml.NodeBuilder.DEBUG
spade.xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-123', 'DEBUG', 'link-28');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">"TLS unsupported by remote server; Doing nothing -- Prob. jabber.org?"</tt><tt class="py-op">,</tt><tt class="py-string">'warn'</tt><tt class="py-op">)</tt> </tt>
<a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> </tt>
<a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-124" class="py-name"><a title="spade.Agent.AbstractAgent.DEBUG
spade.spade_backend.SpadeBackend.DEBUG
spade.xmpp.client.PlugIn.DEBUG
spade.xmpp.simplexml.NodeBuilder.DEBUG
spade.xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-124', 'DEBUG', 'link-28');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">"TLS supported by remote server. Requesting TLS start."</tt><tt class="py-op">,</tt><tt class="py-string">'ok'</tt><tt class="py-op">)</tt> </tt>
<a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line">            <tt id="link-125" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-125', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-126" class="py-name" targets="Method spade.xmpp.session.Session.start_feature()=spade.xmpp.session.Session-class.html#start_feature,Method spade.xmppd.xmppd.Session.start_feature()=spade.xmppd.xmppd.Session-class.html#start_feature"><a title="spade.xmpp.session.Session.start_feature
spade.xmppd.xmppd.Session.start_feature" class="py-name" href="#" onclick="return doclink('link-126', 'start_feature', 'link-126');">start_feature</a></tt><tt class="py-op">(</tt><tt id="link-127" class="py-name"><a title="spade.Agent.NS_TLS
spade.MTP.NS_TLS
spade.Organization.NS_TLS
spade.Organization_new.NS_TLS
spade.Unit.NS_TLS
spade.Unit_new.NS_TLS
spade.pubsub.NS_TLS
spade.socialnetwork.NS_TLS
spade.xmpp.NS_TLS
spade.xmpp.auth.NS_TLS
spade.xmpp.browser.NS_TLS
spade.xmpp.commands.NS_TLS
spade.xmpp.dispatcher.NS_TLS
spade.xmpp.features.NS_TLS
spade.xmpp.filetransfer.NS_TLS
spade.xmpp.protocol.NS_TLS
spade.xmpp.roster.NS_TLS
spade.xmpp.transports.NS_TLS
spade.xmppd.modules.config.NS_TLS
spade.xmppd.modules.db_fake.NS_TLS
spade.xmppd.modules.dialback.NS_TLS
spade.xmppd.modules.jep0077.NS_TLS
spade.xmppd.modules.jep0078.NS_TLS
spade.xmppd.modules.message.NS_TLS
spade.xmppd.modules.muc.NS_TLS
spade.xmppd.modules.oob.NS_TLS
spade.xmppd.modules.pubsub.NS_TLS
spade.xmppd.modules.roster.NS_TLS
spade.xmppd.modules.router.NS_TLS
spade.xmppd.modules.stream.NS_TLS
spade.xmppd.modules.webadmin.NS_TLS
spade.xmppd.modules.wq.NS_TLS
spade.xmppd.xmppd.NS_TLS" class="py-name" href="#" onclick="return doclink('link-127', 'NS_TLS', 'link-5');">NS_TLS</a></tt><tt class="py-op">)</tt> </tt>
<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line">            <tt id="link-128" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-128', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-129" class="py-name"><a title="spade.Agent.AbstractAgent.send
spade.MTP.MTP.send
spade.xmpp.dispatcher.Dispatcher.send
spade.xmpp.transports.TCPsocket.send
spade.xmppd.xmppd.RPC_Client.send
spade.xmppd.xmppd.Session.send" class="py-name" href="#" onclick="return doclink('link-129', 'send', 'link-25');">send</a></tt><tt class="py-op">(</tt><tt id="link-130" class="py-name"><a title="spade.xmpp.simplexml.Node" class="py-name" href="#" onclick="return doclink('link-130', 'Node', 'link-26');">Node</a></tt><tt class="py-op">(</tt><tt class="py-string">'starttls'</tt><tt class="py-op">,</tt><tt class="py-op">{</tt><tt class="py-string">'xmlns'</tt><tt class="py-op">:</tt><tt id="link-131" class="py-name"><a title="spade.Agent.NS_TLS
spade.MTP.NS_TLS
spade.Organization.NS_TLS
spade.Organization_new.NS_TLS
spade.Unit.NS_TLS
spade.Unit_new.NS_TLS
spade.pubsub.NS_TLS
spade.socialnetwork.NS_TLS
spade.xmpp.NS_TLS
spade.xmpp.auth.NS_TLS
spade.xmpp.browser.NS_TLS
spade.xmpp.commands.NS_TLS
spade.xmpp.dispatcher.NS_TLS
spade.xmpp.features.NS_TLS
spade.xmpp.filetransfer.NS_TLS
spade.xmpp.protocol.NS_TLS
spade.xmpp.roster.NS_TLS
spade.xmpp.transports.NS_TLS
spade.xmppd.modules.config.NS_TLS
spade.xmppd.modules.db_fake.NS_TLS
spade.xmppd.modules.dialback.NS_TLS
spade.xmppd.modules.jep0077.NS_TLS
spade.xmppd.modules.jep0078.NS_TLS
spade.xmppd.modules.message.NS_TLS
spade.xmppd.modules.muc.NS_TLS
spade.xmppd.modules.oob.NS_TLS
spade.xmppd.modules.pubsub.NS_TLS
spade.xmppd.modules.roster.NS_TLS
spade.xmppd.modules.router.NS_TLS
spade.xmppd.modules.stream.NS_TLS
spade.xmppd.modules.webadmin.NS_TLS
spade.xmppd.modules.wq.NS_TLS
spade.xmppd.xmppd.NS_TLS" class="py-name" href="#" onclick="return doclink('link-131', 'NS_TLS', 'link-5');">NS_TLS</a></tt><tt class="py-op">}</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line">        <tt class="py-keyword">raise</tt> <tt id="link-132" class="py-name"><a title="spade.xmpp.protocol.NodeProcessed" class="py-name" href="#" onclick="return doclink('link-132', 'NodeProcessed', 'link-32');">NodeProcessed</a></tt> </tt>
</div></div><a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line"> </tt>
<a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">hashlib</tt><tt class="py-op">,</tt><tt class="py-name">base64</tt><tt class="py-op">,</tt><tt class="py-name">random</tt> </tt>
<a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line"> </tt>
<a name="HH"></a><div id="HH-def"><a name="L118"></a><tt class="py-lineno">118</tt> <a class="py-toggle" href="#" id="HH-toggle" onclick="return toggle('HH');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="spade.xmppd.modules.stream-module.html#HH">HH</a><tt class="py-op">(</tt><tt class="py-param">some</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-keyword">return</tt> <tt class="py-name">hashlib</tt><tt class="py-op">.</tt><tt class="py-name">md5</tt><tt class="py-op">(</tt><tt class="py-name">some</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">hexdigest</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="H"></a><div id="H-def"><a name="L119"></a><tt class="py-lineno">119</tt> <a class="py-toggle" href="#" id="H-toggle" onclick="return toggle('H');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="spade.xmppd.modules.stream-module.html#H">H</a><tt class="py-op">(</tt><tt class="py-param">some</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-keyword">return</tt> <tt class="py-name">hashlib</tt><tt class="py-op">.</tt><tt class="py-name">md5</tt><tt class="py-op">(</tt><tt class="py-name">some</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">digest</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="C"></a><div id="C-def"><a name="L120"></a><tt class="py-lineno">120</tt> <a class="py-toggle" href="#" id="C-toggle" onclick="return toggle('C');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="spade.xmppd.modules.stream-module.html#C">C</a><tt class="py-op">(</tt><tt class="py-param">some</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-keyword">return</tt> <tt class="py-string">':'</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-name">some</tt><tt class="py-op">)</tt> </tt>
</div><a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line"> </tt>
<a name="SASL"></a><div id="SASL-def"><a name="L122"></a><tt class="py-lineno">122</tt> <a class="py-toggle" href="#" id="SASL-toggle" onclick="return toggle('SASL');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="spade.xmppd.modules.stream.SASL-class.html">SASL</a><tt class="py-op">(</tt><tt class="py-base-class">PlugIn</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SASL-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="SASL-expanded"><a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line">    <tt id="link-133" class="py-name"><a title="spade.xmppd.modules.config.Config.NS
spade.xmppd.modules.db_fake.AUTH.NS
spade.xmppd.modules.db_fake.DB.NS
spade.xmppd.modules.dialback.Dialback.NS
spade.xmppd.modules.jep0077.IBR.NS
spade.xmppd.modules.jep0078.NSA.NS
spade.xmppd.modules.message.MessageCatcher.NS
spade.xmppd.modules.muc.MUC.NS
spade.xmppd.modules.oob.OOB.NS
spade.xmppd.modules.pubsub.PubSubServer.NS
spade.xmppd.modules.roster.ROSTER.NS
spade.xmppd.modules.router.Router.NS
spade.xmppd.modules.stream.Bind.NS
spade.xmppd.modules.stream.Handshake.NS
spade.xmppd.modules.stream.SASL.NS
spade.xmppd.modules.stream.Session.NS
spade.xmppd.modules.stream.TLS.NS
spade.xmppd.modules.webadmin.WebAdmin.NS
spade.xmppd.modules.wq.WQ.NS" class="py-name" href="#" onclick="return doclink('link-133', 'NS', 'link-4');">NS</a></tt><tt class="py-op">=</tt><tt id="link-134" class="py-name" targets="Variable spade.Agent.NS_SASL=spade.Agent-module.html#NS_SASL,Variable spade.MTP.NS_SASL=spade.MTP-module.html#NS_SASL,Variable spade.Organization.NS_SASL=spade.Organization-module.html#NS_SASL,Variable spade.Organization_new.NS_SASL=spade.Organization_new-module.html#NS_SASL,Variable spade.Unit.NS_SASL=spade.Unit-module.html#NS_SASL,Variable spade.Unit_new.NS_SASL=spade.Unit_new-module.html#NS_SASL,Variable spade.pubsub.NS_SASL=spade.pubsub-module.html#NS_SASL,Variable spade.socialnetwork.NS_SASL=spade.socialnetwork-module.html#NS_SASL,Variable spade.xmpp.NS_SASL=spade.xmpp-module.html#NS_SASL,Variable spade.xmpp.auth.NS_SASL=spade.xmpp.auth-module.html#NS_SASL,Variable spade.xmpp.browser.NS_SASL=spade.xmpp.browser-module.html#NS_SASL,Variable spade.xmpp.commands.NS_SASL=spade.xmpp.commands-module.html#NS_SASL,Variable spade.xmpp.dispatcher.NS_SASL=spade.xmpp.dispatcher-module.html#NS_SASL,Variable spade.xmpp.features.NS_SASL=spade.xmpp.features-module.html#NS_SASL,Variable spade.xmpp.filetransfer.NS_SASL=spade.xmpp.filetransfer-module.html#NS_SASL,Variable spade.xmpp.protocol.NS_SASL=spade.xmpp.protocol-module.html#NS_SASL,Variable spade.xmpp.roster.NS_SASL=spade.xmpp.roster-module.html#NS_SASL,Variable spade.xmpp.transports.NS_SASL=spade.xmpp.transports-module.html#NS_SASL,Variable spade.xmppd.modules.config.NS_SASL=spade.xmppd.modules.config-module.html#NS_SASL,Variable spade.xmppd.modules.db_fake.NS_SASL=spade.xmppd.modules.db_fake-module.html#NS_SASL,Variable spade.xmppd.modules.dialback.NS_SASL=spade.xmppd.modules.dialback-module.html#NS_SASL,Variable spade.xmppd.modules.jep0077.NS_SASL=spade.xmppd.modules.jep0077-module.html#NS_SASL,Variable spade.xmppd.modules.jep0078.NS_SASL=spade.xmppd.modules.jep0078-module.html#NS_SASL,Variable spade.xmppd.modules.message.NS_SASL=spade.xmppd.modules.message-module.html#NS_SASL,Variable spade.xmppd.modules.muc.NS_SASL=spade.xmppd.modules.muc-module.html#NS_SASL,Variable spade.xmppd.modules.oob.NS_SASL=spade.xmppd.modules.oob-module.html#NS_SASL,Variable spade.xmppd.modules.pubsub.NS_SASL=spade.xmppd.modules.pubsub-module.html#NS_SASL,Variable spade.xmppd.modules.roster.NS_SASL=spade.xmppd.modules.roster-module.html#NS_SASL,Variable spade.xmppd.modules.router.NS_SASL=spade.xmppd.modules.router-module.html#NS_SASL,Variable spade.xmppd.modules.stream.NS_SASL=spade.xmppd.modules.stream-module.html#NS_SASL,Variable spade.xmppd.modules.webadmin.NS_SASL=spade.xmppd.modules.webadmin-module.html#NS_SASL,Variable spade.xmppd.modules.wq.NS_SASL=spade.xmppd.modules.wq-module.html#NS_SASL,Variable spade.xmppd.xmppd.NS_SASL=spade.xmppd.xmppd-module.html#NS_SASL"><a title="spade.Agent.NS_SASL
spade.MTP.NS_SASL
spade.Organization.NS_SASL
spade.Organization_new.NS_SASL
spade.Unit.NS_SASL
spade.Unit_new.NS_SASL
spade.pubsub.NS_SASL
spade.socialnetwork.NS_SASL
spade.xmpp.NS_SASL
spade.xmpp.auth.NS_SASL
spade.xmpp.browser.NS_SASL
spade.xmpp.commands.NS_SASL
spade.xmpp.dispatcher.NS_SASL
spade.xmpp.features.NS_SASL
spade.xmpp.filetransfer.NS_SASL
spade.xmpp.protocol.NS_SASL
spade.xmpp.roster.NS_SASL
spade.xmpp.transports.NS_SASL
spade.xmppd.modules.config.NS_SASL
spade.xmppd.modules.db_fake.NS_SASL
spade.xmppd.modules.dialback.NS_SASL
spade.xmppd.modules.jep0077.NS_SASL
spade.xmppd.modules.jep0078.NS_SASL
spade.xmppd.modules.message.NS_SASL
spade.xmppd.modules.muc.NS_SASL
spade.xmppd.modules.oob.NS_SASL
spade.xmppd.modules.pubsub.NS_SASL
spade.xmppd.modules.roster.NS_SASL
spade.xmppd.modules.router.NS_SASL
spade.xmppd.modules.stream.NS_SASL
spade.xmppd.modules.webadmin.NS_SASL
spade.xmppd.modules.wq.NS_SASL
spade.xmppd.xmppd.NS_SASL" class="py-name" href="#" onclick="return doclink('link-134', 'NS_SASL', 'link-134');">NS_SASL</a></tt> </tt>
<a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line">    <tt class="py-string">""" 3.                        &lt;features/&gt;</tt> </tt>
<a name="L125"></a><tt class="py-lineno">125</tt>  <tt class="py-line"><tt class="py-string">        4. &lt;auth/&gt;</tt> </tt>
<a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line"><tt class="py-string">        5.                        &lt;challenge/&gt; / &lt;failure/&gt;</tt> </tt>
<a name="L127"></a><tt class="py-lineno">127</tt>  <tt class="py-line"><tt class="py-string">        6. &lt;response/&gt;</tt> </tt>
<a name="L128"></a><tt class="py-lineno">128</tt>  <tt class="py-line"><tt class="py-string">        7.                        &lt;challenge/&gt; / &lt;failure/&gt;</tt> </tt>
<a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line"><tt class="py-string">        8. &lt;response/&gt; / &lt;abort/&gt;</tt> </tt>
<a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line"><tt class="py-string">        9.                        &lt;success/&gt;   / &lt;failure/&gt;</tt> </tt>
<a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line"><tt class="py-string">        feature SASL, unfeature TLS</tt> </tt>
<a name="L132"></a><tt class="py-lineno">132</tt>  <tt class="py-line"><tt class="py-string">        -- NEW STREAM on success --</tt> </tt>
<a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line"><tt class="py-string"></tt> </tt>
<a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line"><tt class="py-string">        What to do on failure (remote server rejected us)?</tt> </tt>
<a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line"><tt class="py-string">        Probably drop the stream, mark this server as unreachable for several hours and notify admin?</tt> </tt>
<a name="L136"></a><tt class="py-lineno">136</tt>  <tt class="py-line"><tt class="py-string">        If client supplied wrong credentials allow him to retry (configurable number of times).</tt> </tt>
<a name="L137"></a><tt class="py-lineno">137</tt>  <tt class="py-line"><tt class="py-string">        """</tt> </tt>
<a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line"> </tt>
<a name="SASL.plugin"></a><div id="SASL.plugin-def"><a name="L139"></a><tt class="py-lineno">139</tt> <a class="py-toggle" href="#" id="SASL.plugin-toggle" onclick="return toggle('SASL.plugin');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="spade.xmppd.modules.stream.SASL-class.html#plugin">plugin</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">server</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SASL.plugin-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SASL.plugin-expanded"><a name="L140"></a><tt class="py-lineno">140</tt>  <tt class="py-line">        <tt class="py-name">server</tt><tt class="py-op">.</tt><tt id="link-135" class="py-name"><a title="spade.xmpp.dispatcher.Dispatcher" class="py-name" href="#" onclick="return doclink('link-135', 'Dispatcher', 'link-6');">Dispatcher</a></tt><tt class="py-op">.</tt><tt id="link-136" class="py-name" targets="Method spade.xmpp.dispatcher.Dispatcher.RegisterNamespaceHandler()=spade.xmpp.dispatcher.Dispatcher-class.html#RegisterNamespaceHandler"><a title="spade.xmpp.dispatcher.Dispatcher.RegisterNamespaceHandler" class="py-name" href="#" onclick="return doclink('link-136', 'RegisterNamespaceHandler', 'link-136');">RegisterNamespaceHandler</a></tt><tt class="py-op">(</tt><tt id="link-137" class="py-name"><a title="spade.Agent.NS_SASL
spade.MTP.NS_SASL
spade.Organization.NS_SASL
spade.Organization_new.NS_SASL
spade.Unit.NS_SASL
spade.Unit_new.NS_SASL
spade.pubsub.NS_SASL
spade.socialnetwork.NS_SASL
spade.xmpp.NS_SASL
spade.xmpp.auth.NS_SASL
spade.xmpp.browser.NS_SASL
spade.xmpp.commands.NS_SASL
spade.xmpp.dispatcher.NS_SASL
spade.xmpp.features.NS_SASL
spade.xmpp.filetransfer.NS_SASL
spade.xmpp.protocol.NS_SASL
spade.xmpp.roster.NS_SASL
spade.xmpp.transports.NS_SASL
spade.xmppd.modules.config.NS_SASL
spade.xmppd.modules.db_fake.NS_SASL
spade.xmppd.modules.dialback.NS_SASL
spade.xmppd.modules.jep0077.NS_SASL
spade.xmppd.modules.jep0078.NS_SASL
spade.xmppd.modules.message.NS_SASL
spade.xmppd.modules.muc.NS_SASL
spade.xmppd.modules.oob.NS_SASL
spade.xmppd.modules.pubsub.NS_SASL
spade.xmppd.modules.roster.NS_SASL
spade.xmppd.modules.router.NS_SASL
spade.xmppd.modules.stream.NS_SASL
spade.xmppd.modules.webadmin.NS_SASL
spade.xmppd.modules.wq.NS_SASL
spade.xmppd.xmppd.NS_SASL" class="py-name" href="#" onclick="return doclink('link-137', 'NS_SASL', 'link-134');">NS_SASL</a></tt><tt class="py-op">,</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-138" class="py-name" targets="Method spade.xmpp.auth.SASL.SASLHandler()=spade.xmpp.auth.SASL-class.html#SASLHandler,Method spade.xmppd.modules.stream.SASL.SASLHandler()=spade.xmppd.modules.stream.SASL-class.html#SASLHandler"><a title="spade.xmpp.auth.SASL.SASLHandler
spade.xmppd.modules.stream.SASL.SASLHandler" class="py-name" href="#" onclick="return doclink('link-138', 'SASLHandler', 'link-138');">SASLHandler</a></tt><tt class="py-op">)</tt> </tt>
<a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line"><tt class="py-comment">#        server.Dispatcher.RegisterHandler('features',self.FeaturesHandler,xmlns=NS_STREAMS)</tt> </tt>
<a name="L142"></a><tt class="py-lineno">142</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">mechanisms</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-string">'PLAIN'</tt><tt class="py-op">]</tt><tt class="py-comment">#,'DIGEST-MD5']  # for announce in &lt;features/&gt; tag</tt> </tt>
</div><a name="L143"></a><tt class="py-lineno">143</tt>  <tt class="py-line"> </tt>
<a name="L144"></a><tt class="py-lineno">144</tt>  <tt class="py-line">    <tt class="py-string">"""    def startauth(self,session,username,password):</tt> </tt>
<a name="L145"></a><tt class="py-lineno">145</tt>  <tt class="py-line"><tt class="py-string">        session.username=username</tt> </tt>
<a name="L146"></a><tt class="py-lineno">146</tt>  <tt class="py-line"><tt class="py-string">        session.password=password</tt> </tt>
<a name="L147"></a><tt class="py-lineno">147</tt>  <tt class="py-line"><tt class="py-string">        if session.Stream.features:</tt> </tt>
<a name="L148"></a><tt class="py-lineno">148</tt>  <tt class="py-line"><tt class="py-string">            try: self.FeaturesHandler(session,session.Stream.features)</tt> </tt>
<a name="L149"></a><tt class="py-lineno">149</tt>  <tt class="py-line"><tt class="py-string">            except NodeProcessed: pass</tt> </tt>
<a name="L150"></a><tt class="py-lineno">150</tt>  <tt class="py-line"><tt class="py-string"></tt> </tt>
<a name="L151"></a><tt class="py-lineno">151</tt>  <tt class="py-line"><tt class="py-string">    def FeaturesHandler(self,session,feats):</tt> </tt>
<a name="L152"></a><tt class="py-lineno">152</tt>  <tt class="py-line"><tt class="py-string">        if session.feature_in_process: return     # some other feature is already underway</tt> </tt>
<a name="L153"></a><tt class="py-lineno">153</tt>  <tt class="py-line"><tt class="py-string">        if not session.__dict__.has_key('username'): return</tt> </tt>
<a name="L154"></a><tt class="py-lineno">154</tt>  <tt class="py-line"><tt class="py-string">        if not feats.getTag('mechanisms',namespace=NS_SASL):</tt> </tt>
<a name="L155"></a><tt class="py-lineno">155</tt>  <tt class="py-line"><tt class="py-string">            session.unfeature(NS_SASL)</tt> </tt>
<a name="L156"></a><tt class="py-lineno">156</tt>  <tt class="py-line"><tt class="py-string">            self.DEBUG('SASL not supported by server','error')</tt> </tt>
<a name="L157"></a><tt class="py-lineno">157</tt>  <tt class="py-line"><tt class="py-string">            return</tt> </tt>
<a name="L158"></a><tt class="py-lineno">158</tt>  <tt class="py-line"><tt class="py-string">        mecs=[]</tt> </tt>
<a name="L159"></a><tt class="py-lineno">159</tt>  <tt class="py-line"><tt class="py-string">        for mec in feats.getTag('mechanisms',namespace=NS_SASL).getTags('mechanism'):</tt> </tt>
<a name="L160"></a><tt class="py-lineno">160</tt>  <tt class="py-line"><tt class="py-string">            mecs.append(mec.getData())</tt> </tt>
<a name="L161"></a><tt class="py-lineno">161</tt>  <tt class="py-line"><tt class="py-string">        if "DIGEST-MD5" in mecs:</tt> </tt>
<a name="L162"></a><tt class="py-lineno">162</tt>  <tt class="py-line"><tt class="py-string">            node=Node('auth',attrs={'xmlns':NS_SASL,'mechanism':'DIGEST-MD5'})</tt> </tt>
<a name="L163"></a><tt class="py-lineno">163</tt>  <tt class="py-line"><tt class="py-string">        elif "PLAIN" in mecs:</tt> </tt>
<a name="L164"></a><tt class="py-lineno">164</tt>  <tt class="py-line"><tt class="py-string">            sasl_data='%s\x00%s\x00%s'%(self.username+'@'+session.peer,self.username,self.password)</tt> </tt>
<a name="L165"></a><tt class="py-lineno">165</tt>  <tt class="py-line"><tt class="py-string">            node=Node('auth',attrs={'xmlns':NS_SASL,'mechanism':'PLAIN'},payload=[base64.encodestring(sasl_data)])</tt> </tt>
<a name="L166"></a><tt class="py-lineno">166</tt>  <tt class="py-line"><tt class="py-string">        else:</tt> </tt>
<a name="L167"></a><tt class="py-lineno">167</tt>  <tt class="py-line"><tt class="py-string">            session.startsasl='failure'</tt> </tt>
<a name="L168"></a><tt class="py-lineno">168</tt>  <tt class="py-line"><tt class="py-string">            self.DEBUG('I can only use DIGEST-MD5 and PLAIN mecanisms.','error')</tt> </tt>
<a name="L169"></a><tt class="py-lineno">169</tt>  <tt class="py-line"><tt class="py-string">            return</tt> </tt>
<a name="L170"></a><tt class="py-lineno">170</tt>  <tt class="py-line"><tt class="py-string">        session.startsasl='in-process'</tt> </tt>
<a name="L171"></a><tt class="py-lineno">171</tt>  <tt class="py-line"><tt class="py-string">        session.send(node)</tt> </tt>
<a name="L172"></a><tt class="py-lineno">172</tt>  <tt class="py-line"><tt class="py-string">        raise NodeProcessed</tt> </tt>
<a name="L173"></a><tt class="py-lineno">173</tt>  <tt class="py-line"><tt class="py-string">"""</tt> </tt>
<a name="SASL.commit_auth"></a><div id="SASL.commit_auth-def"><a name="L174"></a><tt class="py-lineno">174</tt> <a class="py-toggle" href="#" id="SASL.commit_auth-toggle" onclick="return toggle('SASL.commit_auth');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="spade.xmppd.modules.stream.SASL-class.html#commit_auth">commit_auth</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">session</tt><tt class="py-op">,</tt><tt class="py-param">authzid</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SASL.commit_auth-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SASL.commit_auth-expanded"><a name="L175"></a><tt class="py-lineno">175</tt>  <tt class="py-line">        <tt id="link-139" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-139', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-140" class="py-name"><a title="spade.Agent.AbstractAgent.send
spade.MTP.MTP.send
spade.xmpp.dispatcher.Dispatcher.send
spade.xmpp.transports.TCPsocket.send
spade.xmppd.xmppd.RPC_Client.send
spade.xmppd.xmppd.Session.send" class="py-name" href="#" onclick="return doclink('link-140', 'send', 'link-25');">send</a></tt><tt class="py-op">(</tt><tt id="link-141" class="py-name"><a title="spade.xmpp.simplexml.Node" class="py-name" href="#" onclick="return doclink('link-141', 'Node', 'link-26');">Node</a></tt><tt class="py-op">(</tt><tt class="py-string">'success'</tt><tt class="py-op">,</tt><tt class="py-op">{</tt><tt class="py-string">'xmlns'</tt><tt class="py-op">:</tt><tt id="link-142" class="py-name"><a title="spade.Agent.NS_SASL
spade.MTP.NS_SASL
spade.Organization.NS_SASL
spade.Organization_new.NS_SASL
spade.Unit.NS_SASL
spade.Unit_new.NS_SASL
spade.pubsub.NS_SASL
spade.socialnetwork.NS_SASL
spade.xmpp.NS_SASL
spade.xmpp.auth.NS_SASL
spade.xmpp.browser.NS_SASL
spade.xmpp.commands.NS_SASL
spade.xmpp.dispatcher.NS_SASL
spade.xmpp.features.NS_SASL
spade.xmpp.filetransfer.NS_SASL
spade.xmpp.protocol.NS_SASL
spade.xmpp.roster.NS_SASL
spade.xmpp.transports.NS_SASL
spade.xmppd.modules.config.NS_SASL
spade.xmppd.modules.db_fake.NS_SASL
spade.xmppd.modules.dialback.NS_SASL
spade.xmppd.modules.jep0077.NS_SASL
spade.xmppd.modules.jep0078.NS_SASL
spade.xmppd.modules.message.NS_SASL
spade.xmppd.modules.muc.NS_SASL
spade.xmppd.modules.oob.NS_SASL
spade.xmppd.modules.pubsub.NS_SASL
spade.xmppd.modules.roster.NS_SASL
spade.xmppd.modules.router.NS_SASL
spade.xmppd.modules.stream.NS_SASL
spade.xmppd.modules.webadmin.NS_SASL
spade.xmppd.modules.wq.NS_SASL
spade.xmppd.xmppd.NS_SASL" class="py-name" href="#" onclick="return doclink('link-142', 'NS_SASL', 'link-134');">NS_SASL</a></tt><tt class="py-op">}</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L176"></a><tt class="py-lineno">176</tt>  <tt class="py-line">        <tt id="link-143" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-143', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-144" class="py-name"><a title="spade.xmpp.session.Session.feature
spade.xmppd.xmppd.Server.feature
spade.xmppd.xmppd.Session.feature" class="py-name" href="#" onclick="return doclink('link-144', 'feature', 'link-78');">feature</a></tt><tt class="py-op">(</tt><tt id="link-145" class="py-name"><a title="spade.Agent.NS_SASL
spade.MTP.NS_SASL
spade.Organization.NS_SASL
spade.Organization_new.NS_SASL
spade.Unit.NS_SASL
spade.Unit_new.NS_SASL
spade.pubsub.NS_SASL
spade.socialnetwork.NS_SASL
spade.xmpp.NS_SASL
spade.xmpp.auth.NS_SASL
spade.xmpp.browser.NS_SASL
spade.xmpp.commands.NS_SASL
spade.xmpp.dispatcher.NS_SASL
spade.xmpp.features.NS_SASL
spade.xmpp.filetransfer.NS_SASL
spade.xmpp.protocol.NS_SASL
spade.xmpp.roster.NS_SASL
spade.xmpp.transports.NS_SASL
spade.xmppd.modules.config.NS_SASL
spade.xmppd.modules.db_fake.NS_SASL
spade.xmppd.modules.dialback.NS_SASL
spade.xmppd.modules.jep0077.NS_SASL
spade.xmppd.modules.jep0078.NS_SASL
spade.xmppd.modules.message.NS_SASL
spade.xmppd.modules.muc.NS_SASL
spade.xmppd.modules.oob.NS_SASL
spade.xmppd.modules.pubsub.NS_SASL
spade.xmppd.modules.roster.NS_SASL
spade.xmppd.modules.router.NS_SASL
spade.xmppd.modules.stream.NS_SASL
spade.xmppd.modules.webadmin.NS_SASL
spade.xmppd.modules.wq.NS_SASL
spade.xmppd.xmppd.NS_SASL" class="py-name" href="#" onclick="return doclink('link-145', 'NS_SASL', 'link-134');">NS_SASL</a></tt><tt class="py-op">)</tt> </tt>
<a name="L177"></a><tt class="py-lineno">177</tt>  <tt class="py-line">        <tt id="link-146" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-146', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-147" class="py-name"><a title="spade.xmpp.session.Session.unfeature
spade.xmppd.xmppd.Server.unfeature
spade.xmppd.xmppd.Session.unfeature" class="py-name" href="#" onclick="return doclink('link-147', 'unfeature', 'link-30');">unfeature</a></tt><tt class="py-op">(</tt><tt id="link-148" class="py-name"><a title="spade.Agent.NS_TLS
spade.MTP.NS_TLS
spade.Organization.NS_TLS
spade.Organization_new.NS_TLS
spade.Unit.NS_TLS
spade.Unit_new.NS_TLS
spade.pubsub.NS_TLS
spade.socialnetwork.NS_TLS
spade.xmpp.NS_TLS
spade.xmpp.auth.NS_TLS
spade.xmpp.browser.NS_TLS
spade.xmpp.commands.NS_TLS
spade.xmpp.dispatcher.NS_TLS
spade.xmpp.features.NS_TLS
spade.xmpp.filetransfer.NS_TLS
spade.xmpp.protocol.NS_TLS
spade.xmpp.roster.NS_TLS
spade.xmpp.transports.NS_TLS
spade.xmppd.modules.config.NS_TLS
spade.xmppd.modules.db_fake.NS_TLS
spade.xmppd.modules.dialback.NS_TLS
spade.xmppd.modules.jep0077.NS_TLS
spade.xmppd.modules.jep0078.NS_TLS
spade.xmppd.modules.message.NS_TLS
spade.xmppd.modules.muc.NS_TLS
spade.xmppd.modules.oob.NS_TLS
spade.xmppd.modules.pubsub.NS_TLS
spade.xmppd.modules.roster.NS_TLS
spade.xmppd.modules.router.NS_TLS
spade.xmppd.modules.stream.NS_TLS
spade.xmppd.modules.webadmin.NS_TLS
spade.xmppd.modules.wq.NS_TLS
spade.xmppd.xmppd.NS_TLS" class="py-name" href="#" onclick="return doclink('link-148', 'NS_TLS', 'link-5');">NS_TLS</a></tt><tt class="py-op">)</tt> </tt>
<a name="L178"></a><tt class="py-lineno">178</tt>  <tt class="py-line">        <tt id="link-149" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-149', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">sasl</tt><tt class="py-op">[</tt><tt class="py-string">'next'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L179"></a><tt class="py-lineno">179</tt>  <tt class="py-line">        <tt id="link-150" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-150', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-151" class="py-name"><a title="spade.xmpp.session.Session.StartStream
spade.xmppd.xmppd.Session.StartStream" class="py-name" href="#" onclick="return doclink('link-151', 'StartStream', 'link-84');">StartStream</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L180"></a><tt class="py-lineno">180</tt>  <tt class="py-line">        <tt id="link-152" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-152', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">peer</tt><tt class="py-op">=</tt><tt class="py-name">authzid</tt><tt class="py-op">.</tt><tt class="py-name">lower</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L181"></a><tt class="py-lineno">181</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-153" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-153', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">xmlns</tt><tt class="py-op">==</tt><tt id="link-154" class="py-name" targets="Variable spade.Agent.NS_CLIENT=spade.Agent-module.html#NS_CLIENT,Variable spade.MTP.NS_CLIENT=spade.MTP-module.html#NS_CLIENT,Variable spade.Organization.NS_CLIENT=spade.Organization-module.html#NS_CLIENT,Variable spade.Organization_new.NS_CLIENT=spade.Organization_new-module.html#NS_CLIENT,Variable spade.Unit.NS_CLIENT=spade.Unit-module.html#NS_CLIENT,Variable spade.Unit_new.NS_CLIENT=spade.Unit_new-module.html#NS_CLIENT,Variable spade.pubsub.NS_CLIENT=spade.pubsub-module.html#NS_CLIENT,Variable spade.socialnetwork.NS_CLIENT=spade.socialnetwork-module.html#NS_CLIENT,Variable spade.xmpp.NS_CLIENT=spade.xmpp-module.html#NS_CLIENT,Variable spade.xmpp.auth.NS_CLIENT=spade.xmpp.auth-module.html#NS_CLIENT,Variable spade.xmpp.browser.NS_CLIENT=spade.xmpp.browser-module.html#NS_CLIENT,Variable spade.xmpp.commands.NS_CLIENT=spade.xmpp.commands-module.html#NS_CLIENT,Variable spade.xmpp.dispatcher.NS_CLIENT=spade.xmpp.dispatcher-module.html#NS_CLIENT,Variable spade.xmpp.features.NS_CLIENT=spade.xmpp.features-module.html#NS_CLIENT,Variable spade.xmpp.filetransfer.NS_CLIENT=spade.xmpp.filetransfer-module.html#NS_CLIENT,Variable spade.xmpp.protocol.NS_CLIENT=spade.xmpp.protocol-module.html#NS_CLIENT,Variable spade.xmpp.roster.NS_CLIENT=spade.xmpp.roster-module.html#NS_CLIENT,Variable spade.xmpp.transports.NS_CLIENT=spade.xmpp.transports-module.html#NS_CLIENT,Variable spade.xmppd.modules.config.NS_CLIENT=spade.xmppd.modules.config-module.html#NS_CLIENT,Variable spade.xmppd.modules.db_fake.NS_CLIENT=spade.xmppd.modules.db_fake-module.html#NS_CLIENT,Variable spade.xmppd.modules.dialback.NS_CLIENT=spade.xmppd.modules.dialback-module.html#NS_CLIENT,Variable spade.xmppd.modules.jep0077.NS_CLIENT=spade.xmppd.modules.jep0077-module.html#NS_CLIENT,Variable spade.xmppd.modules.jep0078.NS_CLIENT=spade.xmppd.modules.jep0078-module.html#NS_CLIENT,Variable spade.xmppd.modules.message.NS_CLIENT=spade.xmppd.modules.message-module.html#NS_CLIENT,Variable spade.xmppd.modules.muc.NS_CLIENT=spade.xmppd.modules.muc-module.html#NS_CLIENT,Variable spade.xmppd.modules.oob.NS_CLIENT=spade.xmppd.modules.oob-module.html#NS_CLIENT,Variable spade.xmppd.modules.pubsub.NS_CLIENT=spade.xmppd.modules.pubsub-module.html#NS_CLIENT,Variable spade.xmppd.modules.roster.NS_CLIENT=spade.xmppd.modules.roster-module.html#NS_CLIENT,Variable spade.xmppd.modules.router.NS_CLIENT=spade.xmppd.modules.router-module.html#NS_CLIENT,Variable spade.xmppd.modules.stream.NS_CLIENT=spade.xmppd.modules.stream-module.html#NS_CLIENT,Variable spade.xmppd.modules.webadmin.NS_CLIENT=spade.xmppd.modules.webadmin-module.html#NS_CLIENT,Variable spade.xmppd.modules.wq.NS_CLIENT=spade.xmppd.modules.wq-module.html#NS_CLIENT,Variable spade.xmppd.xmppd.NS_CLIENT=spade.xmppd.xmppd-module.html#NS_CLIENT"><a title="spade.Agent.NS_CLIENT
spade.MTP.NS_CLIENT
spade.Organization.NS_CLIENT
spade.Organization_new.NS_CLIENT
spade.Unit.NS_CLIENT
spade.Unit_new.NS_CLIENT
spade.pubsub.NS_CLIENT
spade.socialnetwork.NS_CLIENT
spade.xmpp.NS_CLIENT
spade.xmpp.auth.NS_CLIENT
spade.xmpp.browser.NS_CLIENT
spade.xmpp.commands.NS_CLIENT
spade.xmpp.dispatcher.NS_CLIENT
spade.xmpp.features.NS_CLIENT
spade.xmpp.filetransfer.NS_CLIENT
spade.xmpp.protocol.NS_CLIENT
spade.xmpp.roster.NS_CLIENT
spade.xmpp.transports.NS_CLIENT
spade.xmppd.modules.config.NS_CLIENT
spade.xmppd.modules.db_fake.NS_CLIENT
spade.xmppd.modules.dialback.NS_CLIENT
spade.xmppd.modules.jep0077.NS_CLIENT
spade.xmppd.modules.jep0078.NS_CLIENT
spade.xmppd.modules.message.NS_CLIENT
spade.xmppd.modules.muc.NS_CLIENT
spade.xmppd.modules.oob.NS_CLIENT
spade.xmppd.modules.pubsub.NS_CLIENT
spade.xmppd.modules.roster.NS_CLIENT
spade.xmppd.modules.router.NS_CLIENT
spade.xmppd.modules.stream.NS_CLIENT
spade.xmppd.modules.webadmin.NS_CLIENT
spade.xmppd.modules.wq.NS_CLIENT
spade.xmppd.xmppd.NS_CLIENT" class="py-name" href="#" onclick="return doclink('link-154', 'NS_CLIENT', 'link-154');">NS_CLIENT</a></tt><tt class="py-op">:</tt> <tt id="link-155" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-155', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-156" class="py-name" targets="Method spade.xmpp.session.Session.set_session_state()=spade.xmpp.session.Session-class.html#set_session_state,Method spade.xmppd.xmppd.Session.set_session_state()=spade.xmppd.xmppd.Session-class.html#set_session_state"><a title="spade.xmpp.session.Session.set_session_state
spade.xmppd.xmppd.Session.set_session_state" class="py-name" href="#" onclick="return doclink('link-156', 'set_session_state', 'link-156');">set_session_state</a></tt><tt class="py-op">(</tt><tt id="link-157" class="py-name" targets="Variable spade.xmpp.session.SESSION_AUTHED=spade.xmpp.session-module.html#SESSION_AUTHED,Variable spade.xmppd.modules.router.SESSION_AUTHED=spade.xmppd.modules.router-module.html#SESSION_AUTHED,Variable spade.xmppd.modules.stream.SESSION_AUTHED=spade.xmppd.modules.stream-module.html#SESSION_AUTHED,Variable spade.xmppd.xmppd.SESSION_AUTHED=spade.xmppd.xmppd-module.html#SESSION_AUTHED"><a title="spade.xmpp.session.SESSION_AUTHED
spade.xmppd.modules.router.SESSION_AUTHED
spade.xmppd.modules.stream.SESSION_AUTHED
spade.xmppd.xmppd.SESSION_AUTHED" class="py-name" href="#" onclick="return doclink('link-157', 'SESSION_AUTHED', 'link-157');">SESSION_AUTHED</a></tt><tt class="py-op">)</tt> </tt>
<a name="L182"></a><tt class="py-lineno">182</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> <tt id="link-158" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-158', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-159" class="py-name"><a title="spade.xmpp.session.Session.set_session_state
spade.xmppd.xmppd.Session.set_session_state" class="py-name" href="#" onclick="return doclink('link-159', 'set_session_state', 'link-156');">set_session_state</a></tt><tt class="py-op">(</tt><tt id="link-160" class="py-name" targets="Variable spade.xmpp.session.SESSION_BOUND=spade.xmpp.session-module.html#SESSION_BOUND,Variable spade.xmppd.modules.router.SESSION_BOUND=spade.xmppd.modules.router-module.html#SESSION_BOUND,Variable spade.xmppd.modules.stream.SESSION_BOUND=spade.xmppd.modules.stream-module.html#SESSION_BOUND,Variable spade.xmppd.xmppd.SESSION_BOUND=spade.xmppd.xmppd-module.html#SESSION_BOUND"><a title="spade.xmpp.session.SESSION_BOUND
spade.xmppd.modules.router.SESSION_BOUND
spade.xmppd.modules.stream.SESSION_BOUND
spade.xmppd.xmppd.SESSION_BOUND" class="py-name" href="#" onclick="return doclink('link-160', 'SESSION_BOUND', 'link-160');">SESSION_BOUND</a></tt><tt class="py-op">)</tt> </tt>
<a name="L183"></a><tt class="py-lineno">183</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-161" class="py-name"><a title="spade.Agent.AbstractAgent.DEBUG
spade.spade_backend.SpadeBackend.DEBUG
spade.xmpp.client.PlugIn.DEBUG
spade.xmpp.simplexml.NodeBuilder.DEBUG
spade.xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-161', 'DEBUG', 'link-28');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">'Peer %s successfully authenticated'</tt><tt class="py-op">%</tt><tt class="py-name">authzid</tt><tt class="py-op">,</tt><tt class="py-string">'ok'</tt><tt class="py-op">)</tt> </tt>
<a name="L184"></a><tt class="py-lineno">184</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt id="link-162" class="py-name" targets="Method spade.xmppd.xmppd.Server.activatesession()=spade.xmppd.xmppd.Server-class.html#activatesession"><a title="spade.xmppd.xmppd.Server.activatesession" class="py-name" href="#" onclick="return doclink('link-162', 'activatesession', 'link-162');">activatesession</a></tt><tt class="py-op">(</tt><tt id="link-163" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-163', 'session', 'link-22');">session</a></tt><tt class="py-op">,</tt><tt class="py-name">authzid</tt><tt class="py-op">)</tt> </tt>
</div><a name="L185"></a><tt class="py-lineno">185</tt>  <tt class="py-line"> </tt>
<a name="SASL.reject_auth"></a><div id="SASL.reject_auth-def"><a name="L186"></a><tt class="py-lineno">186</tt> <a class="py-toggle" href="#" id="SASL.reject_auth-toggle" onclick="return toggle('SASL.reject_auth');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="spade.xmppd.modules.stream.SASL-class.html#reject_auth">reject_auth</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">session</tt><tt class="py-op">,</tt><tt class="py-param">authzid</tt><tt class="py-op">=</tt><tt class="py-string">'unknown'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SASL.reject_auth-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SASL.reject_auth-expanded"><a name="L187"></a><tt class="py-lineno">187</tt>  <tt class="py-line">        <tt id="link-164" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-164', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-165" class="py-name"><a title="spade.Agent.AbstractAgent.send
spade.MTP.MTP.send
spade.xmpp.dispatcher.Dispatcher.send
spade.xmpp.transports.TCPsocket.send
spade.xmppd.xmppd.RPC_Client.send
spade.xmppd.xmppd.Session.send" class="py-name" href="#" onclick="return doclink('link-165', 'send', 'link-25');">send</a></tt><tt class="py-op">(</tt><tt id="link-166" class="py-name"><a title="spade.xmpp.simplexml.Node" class="py-name" href="#" onclick="return doclink('link-166', 'Node', 'link-26');">Node</a></tt><tt class="py-op">(</tt><tt class="py-string">'failure'</tt><tt class="py-op">,</tt><tt class="py-op">{</tt><tt class="py-string">'xmlns'</tt><tt class="py-op">:</tt><tt id="link-167" class="py-name"><a title="spade.Agent.NS_SASL
spade.MTP.NS_SASL
spade.Organization.NS_SASL
spade.Organization_new.NS_SASL
spade.Unit.NS_SASL
spade.Unit_new.NS_SASL
spade.pubsub.NS_SASL
spade.socialnetwork.NS_SASL
spade.xmpp.NS_SASL
spade.xmpp.auth.NS_SASL
spade.xmpp.browser.NS_SASL
spade.xmpp.commands.NS_SASL
spade.xmpp.dispatcher.NS_SASL
spade.xmpp.features.NS_SASL
spade.xmpp.filetransfer.NS_SASL
spade.xmpp.protocol.NS_SASL
spade.xmpp.roster.NS_SASL
spade.xmpp.transports.NS_SASL
spade.xmppd.modules.config.NS_SASL
spade.xmppd.modules.db_fake.NS_SASL
spade.xmppd.modules.dialback.NS_SASL
spade.xmppd.modules.jep0077.NS_SASL
spade.xmppd.modules.jep0078.NS_SASL
spade.xmppd.modules.message.NS_SASL
spade.xmppd.modules.muc.NS_SASL
spade.xmppd.modules.oob.NS_SASL
spade.xmppd.modules.pubsub.NS_SASL
spade.xmppd.modules.roster.NS_SASL
spade.xmppd.modules.router.NS_SASL
spade.xmppd.modules.stream.NS_SASL
spade.xmppd.modules.webadmin.NS_SASL
spade.xmppd.modules.wq.NS_SASL
spade.xmppd.xmppd.NS_SASL" class="py-name" href="#" onclick="return doclink('link-167', 'NS_SASL', 'link-134');">NS_SASL</a></tt><tt class="py-op">}</tt><tt class="py-op">,</tt><tt class="py-op">[</tt><tt id="link-168" class="py-name"><a title="spade.xmpp.simplexml.Node" class="py-name" href="#" onclick="return doclink('link-168', 'Node', 'link-26');">Node</a></tt><tt class="py-op">(</tt><tt class="py-string">'not-authorized'</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L188"></a><tt class="py-lineno">188</tt>  <tt class="py-line">        <tt id="link-169" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-169', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">sasl</tt><tt class="py-op">[</tt><tt class="py-string">'retries'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt id="link-170" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-170', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">sasl</tt><tt class="py-op">[</tt><tt class="py-string">'retries'</tt><tt class="py-op">]</tt><tt class="py-op">-</tt><tt class="py-number">1</tt> </tt>
<a name="L189"></a><tt class="py-lineno">189</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-171" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-171', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">sasl</tt><tt class="py-op">[</tt><tt class="py-string">'retries'</tt><tt class="py-op">]</tt><tt class="py-op">&lt;=</tt><tt class="py-number">0</tt><tt class="py-op">:</tt> <tt id="link-172" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-172', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-173" class="py-name"><a title="spade.xmpp.session.Session.terminate_stream
spade.xmppd.xmppd.Session.terminate_stream" class="py-name" href="#" onclick="return doclink('link-173', 'terminate_stream', 'link-66');">terminate_stream</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L190"></a><tt class="py-lineno">190</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-174" class="py-name"><a title="spade.Agent.AbstractAgent.DEBUG
spade.spade_backend.SpadeBackend.DEBUG
spade.xmpp.client.PlugIn.DEBUG
spade.xmpp.simplexml.NodeBuilder.DEBUG
spade.xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-174', 'DEBUG', 'link-28');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">'Peer %s failed to authenticate'</tt><tt class="py-op">%</tt><tt class="py-name">authzid</tt><tt class="py-op">,</tt><tt class="py-string">'error'</tt><tt class="py-op">)</tt> </tt>
</div><a name="L191"></a><tt class="py-lineno">191</tt>  <tt class="py-line"> </tt>
<a name="SASL.SASLHandler"></a><div id="SASL.SASLHandler-def"><a name="L192"></a><tt class="py-lineno">192</tt> <a class="py-toggle" href="#" id="SASL.SASLHandler-toggle" onclick="return toggle('SASL.SASLHandler');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="spade.xmppd.modules.stream.SASL-class.html#SASLHandler">SASLHandler</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">session</tt><tt class="py-op">,</tt><tt class="py-param">stanza</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="SASL.SASLHandler-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="SASL.SASLHandler-expanded"><a name="L193"></a><tt class="py-lineno">193</tt>  <tt class="py-line">        <tt class="py-docstring">"""simple username: servername _or_ node@servername : 6.1 (6)</tt> </tt>
<a name="L194"></a><tt class="py-lineno">194</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L195"></a><tt class="py-lineno">195</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-175" class="py-name"><a title="spade.Agent.NS_SASL
spade.MTP.NS_SASL
spade.Organization.NS_SASL
spade.Organization_new.NS_SASL
spade.Unit.NS_SASL
spade.Unit_new.NS_SASL
spade.pubsub.NS_SASL
spade.socialnetwork.NS_SASL
spade.xmpp.NS_SASL
spade.xmpp.auth.NS_SASL
spade.xmpp.browser.NS_SASL
spade.xmpp.commands.NS_SASL
spade.xmpp.dispatcher.NS_SASL
spade.xmpp.features.NS_SASL
spade.xmpp.filetransfer.NS_SASL
spade.xmpp.protocol.NS_SASL
spade.xmpp.roster.NS_SASL
spade.xmpp.transports.NS_SASL
spade.xmppd.modules.config.NS_SASL
spade.xmppd.modules.db_fake.NS_SASL
spade.xmppd.modules.dialback.NS_SASL
spade.xmppd.modules.jep0077.NS_SASL
spade.xmppd.modules.jep0078.NS_SASL
spade.xmppd.modules.message.NS_SASL
spade.xmppd.modules.muc.NS_SASL
spade.xmppd.modules.oob.NS_SASL
spade.xmppd.modules.pubsub.NS_SASL
spade.xmppd.modules.roster.NS_SASL
spade.xmppd.modules.router.NS_SASL
spade.xmppd.modules.stream.NS_SASL
spade.xmppd.modules.webadmin.NS_SASL
spade.xmppd.modules.wq.NS_SASL
spade.xmppd.xmppd.NS_SASL" class="py-name" href="#" onclick="return doclink('link-175', 'NS_SASL', 'link-134');">NS_SASL</a></tt> <tt class="py-keyword">in</tt> <tt id="link-176" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-176', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-177" class="py-name"><a title="spade.xmpp.features" class="py-name" href="#" onclick="return doclink('link-177', 'features', 'link-23');">features</a></tt><tt class="py-op">:</tt> </tt>
<a name="L196"></a><tt class="py-lineno">196</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-178" class="py-name"><a title="spade.Agent.AbstractAgent.DEBUG
spade.spade_backend.SpadeBackend.DEBUG
spade.xmpp.client.PlugIn.DEBUG
spade.xmpp.simplexml.NodeBuilder.DEBUG
spade.xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-178', 'DEBUG', 'link-28');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">'Already authorized. Ignoring SASL stanza.'</tt><tt class="py-op">,</tt><tt class="py-string">'error'</tt><tt class="py-op">)</tt> </tt>
<a name="L197"></a><tt class="py-lineno">197</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt id="link-179" class="py-name"><a title="spade.xmpp.protocol.NodeProcessed" class="py-name" href="#" onclick="return doclink('link-179', 'NodeProcessed', 'link-32');">NodeProcessed</a></tt> </tt>
<a name="L198"></a><tt class="py-lineno">198</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt id="link-180" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-180', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">__dict__</tt><tt class="py-op">.</tt><tt class="py-name">has_key</tt><tt class="py-op">(</tt><tt class="py-string">'sasl'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L199"></a><tt class="py-lineno">199</tt>  <tt class="py-line">            <tt id="link-181" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-181', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">sasl</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-string">'retries'</tt><tt class="py-op">:</tt><tt class="py-number">3</tt><tt class="py-op">}</tt> </tt>
<a name="L200"></a><tt class="py-lineno">200</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt id="link-182" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-182', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">sasl</tt><tt class="py-op">.</tt><tt class="py-name">has_key</tt><tt class="py-op">(</tt><tt class="py-string">'next'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L201"></a><tt class="py-lineno">201</tt>  <tt class="py-line">            <tt id="link-183" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-183', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">sasl</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-string">'retries'</tt><tt class="py-op">:</tt><tt id="link-184" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-184', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">sasl</tt><tt class="py-op">[</tt><tt class="py-string">'retries'</tt><tt class="py-op">]</tt><tt class="py-op">}</tt> </tt>
<a name="L202"></a><tt class="py-lineno">202</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt id="link-185" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-185', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">TYP</tt><tt class="py-op">==</tt><tt class="py-string">'server'</tt><tt class="py-op">:</tt> <tt id="link-186" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-186', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">sasl</tt><tt class="py-op">[</tt><tt class="py-string">'next'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-string">'auth'</tt><tt class="py-op">]</tt> </tt>
<a name="L203"></a><tt class="py-lineno">203</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> <tt id="link-187" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-187', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">sasl</tt><tt class="py-op">[</tt><tt class="py-string">'next'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-string">'challenge'</tt><tt class="py-op">,</tt><tt class="py-string">'success'</tt><tt class="py-op">,</tt><tt class="py-string">'failure'</tt><tt class="py-op">]</tt> </tt>
<a name="L204"></a><tt class="py-lineno">204</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">stanza</tt><tt class="py-op">.</tt><tt id="link-188" class="py-name"><a title="spade.AID.aid.getName
spade.Agent.AbstractAgent.getName
spade.DF.DfAgentDescription.getName
spade.DF.Service.getName
spade.DF.ServiceDescription.getName
spade.pyparsing.ParseResults.getName
spade.xmpp.roster.Roster.getName
spade.xmpp.simplexml.Node.getName
spade.xmppd.modules.muc.Room.getName
spade.xmppd.modules.wq.Group.getName
spade.xmppd.xmppd.Session.getName" class="py-name" href="#" onclick="return doclink('link-188', 'getName', 'link-88');">getName</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-keyword">not</tt> <tt class="py-keyword">in</tt> <tt id="link-189" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-189', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">sasl</tt><tt class="py-op">[</tt><tt class="py-string">'next'</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L205"></a><tt class="py-lineno">205</tt>  <tt class="py-line">            <tt class="py-comment"># screwed SASL implementation on the other side. terminating stream</tt> </tt>
<a name="L206"></a><tt class="py-lineno">206</tt>  <tt class="py-line">            <tt id="link-190" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-190', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-191" class="py-name"><a title="spade.xmpp.session.Session.terminate_stream
spade.xmppd.xmppd.Session.terminate_stream" class="py-name" href="#" onclick="return doclink('link-191', 'terminate_stream', 'link-66');">terminate_stream</a></tt><tt class="py-op">(</tt><tt class="py-name">STREAM_BAD_REQUEST</tt><tt class="py-op">)</tt> </tt>
<a name="L207"></a><tt class="py-lineno">207</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt id="link-192" class="py-name"><a title="spade.xmpp.protocol.NodeProcessed" class="py-name" href="#" onclick="return doclink('link-192', 'NodeProcessed', 'link-32');">NodeProcessed</a></tt> </tt>
<a name="L208"></a><tt class="py-lineno">208</tt>  <tt class="py-line">        <tt class="py-comment">#=================== preparation ===============================================</tt> </tt>
<a name="L209"></a><tt class="py-lineno">209</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> <tt class="py-name">data</tt><tt class="py-op">=</tt><tt class="py-name">base64</tt><tt class="py-op">.</tt><tt class="py-name">decodestring</tt><tt class="py-op">(</tt><tt class="py-name">stanza</tt><tt class="py-op">.</tt><tt id="link-193" class="py-name" targets="Method spade.xmpp.simplexml.Node.getData()=spade.xmpp.simplexml.Node-class.html#getData"><a title="spade.xmpp.simplexml.Node.getData" class="py-name" href="#" onclick="return doclink('link-193', 'getData', 'link-193');">getData</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L210"></a><tt class="py-lineno">210</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt><tt class="py-op">:</tt> </tt>
<a name="L211"></a><tt class="py-lineno">211</tt>  <tt class="py-line">            <tt id="link-194" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-194', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-195" class="py-name"><a title="spade.xmpp.session.Session.terminate_stream
spade.xmppd.xmppd.Session.terminate_stream" class="py-name" href="#" onclick="return doclink('link-195', 'terminate_stream', 'link-66');">terminate_stream</a></tt><tt class="py-op">(</tt><tt class="py-name">STREAM_BAD_REQUEST</tt><tt class="py-op">)</tt> </tt>
<a name="L212"></a><tt class="py-lineno">212</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt id="link-196" class="py-name"><a title="spade.xmpp.protocol.NodeProcessed" class="py-name" href="#" onclick="return doclink('link-196', 'NodeProcessed', 'link-32');">NodeProcessed</a></tt> </tt>
<a name="L213"></a><tt class="py-lineno">213</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-197" class="py-name"><a title="spade.Agent.AbstractAgent.DEBUG
spade.spade_backend.SpadeBackend.DEBUG
spade.xmpp.client.PlugIn.DEBUG
spade.xmpp.simplexml.NodeBuilder.DEBUG
spade.xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-197', 'DEBUG', 'link-28');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">'Got challenge: '</tt><tt class="py-op">+</tt><tt class="py-op">`</tt><tt class="py-name">data</tt><tt class="py-op">`</tt><tt class="py-op">,</tt><tt class="py-string">'ok'</tt><tt class="py-op">)</tt> </tt>
<a name="L214"></a><tt class="py-lineno">214</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">pair</tt> <tt class="py-keyword">in</tt> <tt class="py-name">data</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">','</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L215"></a><tt class="py-lineno">215</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">pair</tt><tt class="py-op">.</tt><tt class="py-name">find</tt><tt class="py-op">(</tt><tt class="py-string">'='</tt><tt class="py-op">)</tt><tt class="py-op">==</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
<a name="L216"></a><tt class="py-lineno">216</tt>  <tt class="py-line">                <tt id="link-198" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-198', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">sasl</tt><tt class="py-op">[</tt><tt class="py-string">'otherdata'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">pair</tt> </tt>
<a name="L217"></a><tt class="py-lineno">217</tt>  <tt class="py-line">                <tt class="py-keyword">continue</tt> </tt>
<a name="L218"></a><tt class="py-lineno">218</tt>  <tt class="py-line">            <tt class="py-name">key</tt><tt class="py-op">,</tt><tt class="py-name">value</tt><tt class="py-op">=</tt><tt class="py-name">pair</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'='</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L219"></a><tt class="py-lineno">219</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">value</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">==</tt><tt class="py-string">'"'</tt> <tt class="py-keyword">and</tt> <tt class="py-name">value</tt><tt class="py-op">[</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">:</tt><tt class="py-op">]</tt><tt class="py-op">==</tt><tt class="py-string">'"'</tt><tt class="py-op">:</tt> <tt class="py-name">value</tt><tt class="py-op">=</tt><tt class="py-name">value</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">:</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
<a name="L220"></a><tt class="py-lineno">220</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">key</tt> <tt class="py-keyword">in</tt> <tt class="py-op">[</tt><tt class="py-string">'qop'</tt><tt class="py-op">,</tt><tt class="py-string">'username'</tt><tt class="py-op">,</tt><tt class="py-string">'realm'</tt><tt class="py-op">,</tt><tt class="py-string">'nonce'</tt><tt class="py-op">,</tt><tt class="py-string">'cnonce'</tt><tt class="py-op">,</tt><tt class="py-string">'digest-uri'</tt><tt class="py-op">,</tt> </tt>
<a name="L221"></a><tt class="py-lineno">221</tt>  <tt class="py-line">                       <tt class="py-string">'nc'</tt><tt class="py-op">,</tt><tt class="py-string">'response'</tt><tt class="py-op">,</tt><tt class="py-string">'charset'</tt><tt class="py-op">,</tt><tt class="py-string">'rspauth'</tt><tt class="py-op">,</tt><tt class="py-string">'algorithm'</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L222"></a><tt class="py-lineno">222</tt>  <tt class="py-line">                <tt class="py-name">chal</tt><tt class="py-op">[</tt><tt class="py-name">key</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">value</tt> </tt>
<a name="L223"></a><tt class="py-lineno">223</tt>  <tt class="py-line">        <tt class="py-comment">#=================== SASL begin ===============================================</tt> </tt>
<a name="L224"></a><tt class="py-lineno">224</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">stanza</tt><tt class="py-op">.</tt><tt id="link-199" class="py-name"><a title="spade.AID.aid.getName
spade.Agent.AbstractAgent.getName
spade.DF.DfAgentDescription.getName
spade.DF.Service.getName
spade.DF.ServiceDescription.getName
spade.pyparsing.ParseResults.getName
spade.xmpp.roster.Roster.getName
spade.xmpp.simplexml.Node.getName
spade.xmppd.modules.muc.Room.getName
spade.xmppd.modules.wq.Group.getName
spade.xmppd.xmppd.Session.getName" class="py-name" href="#" onclick="return doclink('link-199', 'getName', 'link-88');">getName</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">==</tt><tt class="py-string">'auth'</tt><tt class="py-op">:</tt> </tt>
<a name="L225"></a><tt class="py-lineno">225</tt>  <tt class="py-line">            <tt id="link-200" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-200', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">sasl</tt><tt class="py-op">[</tt><tt class="py-string">'next'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-string">'response'</tt><tt class="py-op">,</tt><tt class="py-string">'abort'</tt><tt class="py-op">,</tt><tt class="py-string">'auth'</tt><tt class="py-op">]</tt> </tt>
<a name="L226"></a><tt class="py-lineno">226</tt>  <tt class="py-line">            <tt class="py-comment"># client requested some mechanism. May be ever provided credentials already.</tt> </tt>
<a name="L227"></a><tt class="py-lineno">227</tt>  <tt class="py-line">            <tt class="py-name">mec</tt><tt class="py-op">=</tt><tt class="py-name">stanza</tt><tt class="py-op">[</tt><tt class="py-string">'mechanism'</tt><tt class="py-op">]</tt> </tt>
<a name="L228"></a><tt class="py-lineno">228</tt>  <tt class="py-line">            <tt id="link-201" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-201', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">sasl</tt><tt class="py-op">[</tt><tt class="py-string">'mechanism'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-name">mec</tt> </tt>
<a name="L229"></a><tt class="py-lineno">229</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">mec</tt><tt class="py-op">==</tt><tt class="py-string">'PLAIN'</tt><tt class="py-op">:</tt> </tt>
<a name="L230"></a><tt class="py-lineno">230</tt>  <tt class="py-line">                <tt class="py-string">"""The mechanism consists of a single message from the client to the</tt> </tt>
<a name="L231"></a><tt class="py-lineno">231</tt>  <tt class="py-line"><tt class="py-string">                   server.  The client sends the authorization identity (identity to</tt> </tt>
<a name="L232"></a><tt class="py-lineno">232</tt>  <tt class="py-line"><tt class="py-string">                   login as), followed by a NUL (U+0000) character, followed by the</tt> </tt>
<a name="L233"></a><tt class="py-lineno">233</tt>  <tt class="py-line"><tt class="py-string">                   authentication identity (identity whose password will be used),</tt> </tt>
<a name="L234"></a><tt class="py-lineno">234</tt>  <tt class="py-line"><tt class="py-string">                   followed by a NUL (U+0000) character, followed by the clear-text</tt> </tt>
<a name="L235"></a><tt class="py-lineno">235</tt>  <tt class="py-line"><tt class="py-string">                   password."""</tt> </tt>
<a name="L236"></a><tt class="py-lineno">236</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt id="link-202" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-202', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">sasl</tt><tt class="py-op">.</tt><tt class="py-name">has_key</tt><tt class="py-op">(</tt><tt class="py-string">'otherdata'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-name">pack</tt><tt class="py-op">=</tt><tt id="link-203" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-203', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">sasl</tt><tt class="py-op">[</tt><tt class="py-string">'otherdata'</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'\000'</tt><tt class="py-op">)</tt> </tt>
<a name="L237"></a><tt class="py-lineno">237</tt>  <tt class="py-line">                <tt class="py-keyword">else</tt><tt class="py-op">:</tt> <tt class="py-name">pack</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L238"></a><tt class="py-lineno">238</tt>  <tt class="py-line">                <tt class="py-name">authzid</tt><tt class="py-op">=</tt><tt id="link-204" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-204', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">peer</tt> </tt>
<a name="L239"></a><tt class="py-lineno">239</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">pack</tt><tt class="py-op">)</tt><tt class="py-op">&lt;&gt;</tt><tt class="py-number">3</tt><tt class="py-op">:</tt> <tt class="py-name">res</tt><tt class="py-op">=</tt><tt class="py-number">0</tt> </tt>
<a name="L240"></a><tt class="py-lineno">240</tt>  <tt class="py-line">                <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L241"></a><tt class="py-lineno">241</tt>  <tt class="py-line">                    <tt class="py-name">authzid</tt><tt class="py-op">,</tt> <tt class="py-name">authcid</tt><tt class="py-op">,</tt> <tt class="py-name">passwd</tt> <tt class="py-op">=</tt> <tt class="py-name">pack</tt> </tt>
<a name="L242"></a><tt class="py-lineno">242</tt>  <tt class="py-line">                    <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">authzid</tt><tt class="py-op">:</tt> </tt>
<a name="L243"></a><tt class="py-lineno">243</tt>  <tt class="py-line">                        <tt class="py-name">authzid</tt><tt class="py-op">=</tt><tt class="py-name">authcid</tt> </tt>
<a name="L244"></a><tt class="py-lineno">244</tt>  <tt class="py-line">                        <tt class="py-keyword">if</tt> <tt id="link-205" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-205', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">xmlns</tt><tt class="py-op">==</tt><tt id="link-206" class="py-name"><a title="spade.Agent.NS_CLIENT
spade.MTP.NS_CLIENT
spade.Organization.NS_CLIENT
spade.Organization_new.NS_CLIENT
spade.Unit.NS_CLIENT
spade.Unit_new.NS_CLIENT
spade.pubsub.NS_CLIENT
spade.socialnetwork.NS_CLIENT
spade.xmpp.NS_CLIENT
spade.xmpp.auth.NS_CLIENT
spade.xmpp.browser.NS_CLIENT
spade.xmpp.commands.NS_CLIENT
spade.xmpp.dispatcher.NS_CLIENT
spade.xmpp.features.NS_CLIENT
spade.xmpp.filetransfer.NS_CLIENT
spade.xmpp.protocol.NS_CLIENT
spade.xmpp.roster.NS_CLIENT
spade.xmpp.transports.NS_CLIENT
spade.xmppd.modules.config.NS_CLIENT
spade.xmppd.modules.db_fake.NS_CLIENT
spade.xmppd.modules.dialback.NS_CLIENT
spade.xmppd.modules.jep0077.NS_CLIENT
spade.xmppd.modules.jep0078.NS_CLIENT
spade.xmppd.modules.message.NS_CLIENT
spade.xmppd.modules.muc.NS_CLIENT
spade.xmppd.modules.oob.NS_CLIENT
spade.xmppd.modules.pubsub.NS_CLIENT
spade.xmppd.modules.roster.NS_CLIENT
spade.xmppd.modules.router.NS_CLIENT
spade.xmppd.modules.stream.NS_CLIENT
spade.xmppd.modules.webadmin.NS_CLIENT
spade.xmppd.modules.wq.NS_CLIENT
spade.xmppd.xmppd.NS_CLIENT" class="py-name" href="#" onclick="return doclink('link-206', 'NS_CLIENT', 'link-154');">NS_CLIENT</a></tt><tt class="py-op">:</tt> <tt class="py-name">authzid</tt><tt class="py-op">+=</tt><tt class="py-string">'@'</tt><tt class="py-op">+</tt><tt id="link-207" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-207', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">ourname</tt> </tt>
<a name="L245"></a><tt class="py-lineno">245</tt>  <tt class="py-line">                    <tt class="py-name">username</tt><tt class="py-op">,</tt><tt class="py-name">domain</tt><tt class="py-op">=</tt><tt class="py-op">(</tt><tt class="py-name">authzid</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'@'</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-op">[</tt><tt class="py-string">''</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> </tt>
<a name="L246"></a><tt class="py-lineno">246</tt>  <tt class="py-line">                    <tt class="py-name">res</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt> <tt class="py-name">passwd</tt> <tt class="py-op">==</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt id="link-208" class="py-name" targets="Class spade.xmppd.modules.db_fake.AUTH=spade.xmppd.modules.db_fake.AUTH-class.html"><a title="spade.xmppd.modules.db_fake.AUTH" class="py-name" href="#" onclick="return doclink('link-208', 'AUTH', 'link-208');">AUTH</a></tt><tt class="py-op">.</tt><tt id="link-209" class="py-name" targets="Method spade.xmppd.modules.db_fake.AUTH.getpassword()=spade.xmppd.modules.db_fake.AUTH-class.html#getpassword"><a title="spade.xmppd.modules.db_fake.AUTH.getpassword" class="py-name" href="#" onclick="return doclink('link-209', 'getpassword', 'link-209');">getpassword</a></tt><tt class="py-op">(</tt><tt class="py-name">username</tt><tt class="py-op">,</tt> <tt class="py-name">domain</tt><tt class="py-op">)</tt> <tt class="py-op">)</tt> </tt>
<a name="L247"></a><tt class="py-lineno">247</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">res</tt><tt class="py-op">:</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-210" class="py-name" targets="Method spade.xmppd.modules.stream.SASL.commit_auth()=spade.xmppd.modules.stream.SASL-class.html#commit_auth"><a title="spade.xmppd.modules.stream.SASL.commit_auth" class="py-name" href="#" onclick="return doclink('link-210', 'commit_auth', 'link-210');">commit_auth</a></tt><tt class="py-op">(</tt><tt id="link-211" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-211', 'session', 'link-22');">session</a></tt><tt class="py-op">,</tt><tt class="py-name">authzid</tt><tt class="py-op">)</tt> </tt>
<a name="L248"></a><tt class="py-lineno">248</tt>  <tt class="py-line">                <tt class="py-keyword">else</tt><tt class="py-op">:</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-212" class="py-name" targets="Method spade.xmppd.modules.stream.SASL.reject_auth()=spade.xmppd.modules.stream.SASL-class.html#reject_auth"><a title="spade.xmppd.modules.stream.SASL.reject_auth" class="py-name" href="#" onclick="return doclink('link-212', 'reject_auth', 'link-212');">reject_auth</a></tt><tt class="py-op">(</tt><tt id="link-213" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-213', 'session', 'link-22');">session</a></tt><tt class="py-op">,</tt><tt class="py-name">authzid</tt><tt class="py-op">)</tt> </tt>
<a name="L249"></a><tt class="py-lineno">249</tt>  <tt class="py-line">            <tt class="py-keyword">elif</tt> <tt class="py-name">mec</tt><tt class="py-op">==</tt><tt class="py-string">'DIGEST-MD5'</tt><tt class="py-op">:</tt> <tt class="py-keyword">pass</tt> </tt>
<a name="L250"></a><tt class="py-lineno">250</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L251"></a><tt class="py-lineno">251</tt>  <tt class="py-line">                <tt id="link-214" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-214', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-215" class="py-name"><a title="spade.xmpp.session.Session.terminate_stream
spade.xmppd.xmppd.Session.terminate_stream" class="py-name" href="#" onclick="return doclink('link-215', 'terminate_stream', 'link-66');">terminate_stream</a></tt><tt class="py-op">(</tt><tt id="link-216" class="py-name"><a title="spade.xmpp.simplexml.Node" class="py-name" href="#" onclick="return doclink('link-216', 'Node', 'link-26');">Node</a></tt><tt class="py-op">(</tt><tt class="py-string">'failure'</tt><tt class="py-op">,</tt><tt class="py-op">{</tt><tt class="py-string">'xmlns'</tt><tt class="py-op">:</tt><tt id="link-217" class="py-name"><a title="spade.Agent.NS_SASL
spade.MTP.NS_SASL
spade.Organization.NS_SASL
spade.Organization_new.NS_SASL
spade.Unit.NS_SASL
spade.Unit_new.NS_SASL
spade.pubsub.NS_SASL
spade.socialnetwork.NS_SASL
spade.xmpp.NS_SASL
spade.xmpp.auth.NS_SASL
spade.xmpp.browser.NS_SASL
spade.xmpp.commands.NS_SASL
spade.xmpp.dispatcher.NS_SASL
spade.xmpp.features.NS_SASL
spade.xmpp.filetransfer.NS_SASL
spade.xmpp.protocol.NS_SASL
spade.xmpp.roster.NS_SASL
spade.xmpp.transports.NS_SASL
spade.xmppd.modules.config.NS_SASL
spade.xmppd.modules.db_fake.NS_SASL
spade.xmppd.modules.dialback.NS_SASL
spade.xmppd.modules.jep0077.NS_SASL
spade.xmppd.modules.jep0078.NS_SASL
spade.xmppd.modules.message.NS_SASL
spade.xmppd.modules.muc.NS_SASL
spade.xmppd.modules.oob.NS_SASL
spade.xmppd.modules.pubsub.NS_SASL
spade.xmppd.modules.roster.NS_SASL
spade.xmppd.modules.router.NS_SASL
spade.xmppd.modules.stream.NS_SASL
spade.xmppd.modules.webadmin.NS_SASL
spade.xmppd.modules.wq.NS_SASL
spade.xmppd.xmppd.NS_SASL" class="py-name" href="#" onclick="return doclink('link-217', 'NS_SASL', 'link-134');">NS_SASL</a></tt><tt class="py-op">}</tt><tt class="py-op">,</tt><tt class="py-op">[</tt><tt id="link-218" class="py-name"><a title="spade.xmpp.simplexml.Node" class="py-name" href="#" onclick="return doclink('link-218', 'Node', 'link-26');">Node</a></tt><tt class="py-op">(</tt><tt class="py-string">'invalid-mechanism'</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L252"></a><tt class="py-lineno">252</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt id="link-219" class="py-name"><a title="spade.xmpp.protocol.NodeProcessed" class="py-name" href="#" onclick="return doclink('link-219', 'NodeProcessed', 'link-32');">NodeProcessed</a></tt> </tt>
<a name="L253"></a><tt class="py-lineno">253</tt>  <tt class="py-line">            <tt class="py-string">"""elif stanza.getName()=='challenge':</tt> </tt>
<a name="L254"></a><tt class="py-lineno">254</tt>  <tt class="py-line"><tt class="py-string">            session.sasl['next']=['challenge','success','failure']</tt> </tt>
<a name="L255"></a><tt class="py-lineno">255</tt>  <tt class="py-line"><tt class="py-string">            # DIGEST-MD5 only</tt> </tt>
<a name="L256"></a><tt class="py-lineno">256</tt>  <tt class="py-line"><tt class="py-string">            if chal.has_key('qop') and chal['qop']=='auth':</tt> </tt>
<a name="L257"></a><tt class="py-lineno">257</tt>  <tt class="py-line"><tt class="py-string">                resp={}</tt> </tt>
<a name="L258"></a><tt class="py-lineno">258</tt>  <tt class="py-line"><tt class="py-string">                resp['username']=self.username</tt> </tt>
<a name="L259"></a><tt class="py-lineno">259</tt>  <tt class="py-line"><tt class="py-string">                resp['realm']=self._owner.Server</tt> </tt>
<a name="L260"></a><tt class="py-lineno">260</tt>  <tt class="py-line"><tt class="py-string">                resp['nonce']=chal['nonce']</tt> </tt>
<a name="L261"></a><tt class="py-lineno">261</tt>  <tt class="py-line"><tt class="py-string">                cnonce=''</tt> </tt>
<a name="L262"></a><tt class="py-lineno">262</tt>  <tt class="py-line"><tt class="py-string">                for i in range(7):</tt> </tt>
<a name="L263"></a><tt class="py-lineno">263</tt>  <tt class="py-line"><tt class="py-string">                    cnonce+=hex(int(random.random()*65536*4096))[2:]</tt> </tt>
<a name="L264"></a><tt class="py-lineno">264</tt>  <tt class="py-line"><tt class="py-string">                resp['cnonce']=cnonce</tt> </tt>
<a name="L265"></a><tt class="py-lineno">265</tt>  <tt class="py-line"><tt class="py-string">                resp['nc']=('00000001')</tt> </tt>
<a name="L266"></a><tt class="py-lineno">266</tt>  <tt class="py-line"><tt class="py-string">                resp['qop']='auth'</tt> </tt>
<a name="L267"></a><tt class="py-lineno">267</tt>  <tt class="py-line"><tt class="py-string">                resp['digest-uri']='xmpp/'</tt> </tt>
<a name="L268"></a><tt class="py-lineno">268</tt>  <tt class="py-line"><tt class="py-string">                A1=C([H(C([resp['username'],resp['realm'],self.password])),resp['nonce'],resp['cnonce']])</tt> </tt>
<a name="L269"></a><tt class="py-lineno">269</tt>  <tt class="py-line"><tt class="py-string">                A2=C(['AUTHENTICATE',resp['digest-uri']])</tt> </tt>
<a name="L270"></a><tt class="py-lineno">270</tt>  <tt class="py-line"><tt class="py-string">                response= HH(C([HH(A1),resp['nonce'],resp['nc'],resp['cnonce'],resp['qop'],HH(A2)]))</tt> </tt>
<a name="L271"></a><tt class="py-lineno">271</tt>  <tt class="py-line"><tt class="py-string">                resp['response']=response</tt> </tt>
<a name="L272"></a><tt class="py-lineno">272</tt>  <tt class="py-line"><tt class="py-string">                resp['charset']='utf-8'</tt> </tt>
<a name="L273"></a><tt class="py-lineno">273</tt>  <tt class="py-line"><tt class="py-string">                sasl_data=''</tt> </tt>
<a name="L274"></a><tt class="py-lineno">274</tt>  <tt class="py-line"><tt class="py-string">                for key in ['charset','username','realm','nonce','nc','cnonce','digest-uri','response','qop']:</tt> </tt>
<a name="L275"></a><tt class="py-lineno">275</tt>  <tt class="py-line"><tt class="py-string">                    if key in ['nc','qop','response','charset']: sasl_data+="%s=%s,"%(key,resp[key])</tt> </tt>
<a name="L276"></a><tt class="py-lineno">276</tt>  <tt class="py-line"><tt class="py-string">                    else: sasl_data+='%s="%s",'%(key,resp[key])</tt> </tt>
<a name="L277"></a><tt class="py-lineno">277</tt>  <tt class="py-line"><tt class="py-string">                node=Node('response',attrs={'xmlns':NS_SASL},payload=[base64.encodestring(sasl_data[:-1]).replace('\n','')])</tt> </tt>
<a name="L278"></a><tt class="py-lineno">278</tt>  <tt class="py-line"><tt class="py-string">                self._owner.send(node)</tt> </tt>
<a name="L279"></a><tt class="py-lineno">279</tt>  <tt class="py-line"><tt class="py-string">            elif chal.has_key('rspauth'): self._owner.send(Node('response',attrs={'xmlns':NS_SASL}))</tt> </tt>
<a name="L280"></a><tt class="py-lineno">280</tt>  <tt class="py-line"><tt class="py-string">"""</tt> </tt>
<a name="L281"></a><tt class="py-lineno">281</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">stanza</tt><tt class="py-op">.</tt><tt id="link-220" class="py-name"><a title="spade.AID.aid.getName
spade.Agent.AbstractAgent.getName
spade.DF.DfAgentDescription.getName
spade.DF.Service.getName
spade.DF.ServiceDescription.getName
spade.pyparsing.ParseResults.getName
spade.xmpp.roster.Roster.getName
spade.xmpp.simplexml.Node.getName
spade.xmppd.modules.muc.Room.getName
spade.xmppd.modules.wq.Group.getName
spade.xmppd.xmppd.Session.getName" class="py-name" href="#" onclick="return doclink('link-220', 'getName', 'link-88');">getName</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">==</tt><tt class="py-string">'response'</tt><tt class="py-op">:</tt> </tt>
<a name="L282"></a><tt class="py-lineno">282</tt>  <tt class="py-line">            <tt id="link-221" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-221', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">sasl</tt><tt class="py-op">[</tt><tt class="py-string">'next'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-string">'response'</tt><tt class="py-op">,</tt><tt class="py-string">'abort'</tt><tt class="py-op">]</tt> </tt>
<a name="L283"></a><tt class="py-lineno">283</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">stanza</tt><tt class="py-op">.</tt><tt id="link-222" class="py-name"><a title="spade.AID.aid.getName
spade.Agent.AbstractAgent.getName
spade.DF.DfAgentDescription.getName
spade.DF.Service.getName
spade.DF.ServiceDescription.getName
spade.pyparsing.ParseResults.getName
spade.xmpp.roster.Roster.getName
spade.xmpp.simplexml.Node.getName
spade.xmppd.modules.muc.Room.getName
spade.xmppd.modules.wq.Group.getName
spade.xmppd.xmppd.Session.getName" class="py-name" href="#" onclick="return doclink('link-222', 'getName', 'link-88');">getName</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">==</tt><tt class="py-string">'abort'</tt><tt class="py-op">:</tt> </tt>
<a name="L284"></a><tt class="py-lineno">284</tt>  <tt class="py-line">            <tt id="link-223" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-223', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">sasl</tt><tt class="py-op">[</tt><tt class="py-string">'next'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-string">'auth'</tt><tt class="py-op">]</tt> </tt>
<a name="L285"></a><tt class="py-lineno">285</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">stanza</tt><tt class="py-op">.</tt><tt id="link-224" class="py-name"><a title="spade.AID.aid.getName
spade.Agent.AbstractAgent.getName
spade.DF.DfAgentDescription.getName
spade.DF.Service.getName
spade.DF.ServiceDescription.getName
spade.pyparsing.ParseResults.getName
spade.xmpp.roster.Roster.getName
spade.xmpp.simplexml.Node.getName
spade.xmppd.modules.muc.Room.getName
spade.xmppd.modules.wq.Group.getName
spade.xmppd.xmppd.Session.getName" class="py-name" href="#" onclick="return doclink('link-224', 'getName', 'link-88');">getName</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">==</tt><tt class="py-string">'success'</tt><tt class="py-op">:</tt> </tt>
<a name="L286"></a><tt class="py-lineno">286</tt>  <tt class="py-line">            <tt id="link-225" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-225', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">sasl</tt><tt class="py-op">[</tt><tt class="py-string">'next'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L287"></a><tt class="py-lineno">287</tt>  <tt class="py-line">            <tt id="link-226" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-226', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">startsasl</tt><tt class="py-op">=</tt><tt class="py-string">'success'</tt> </tt>
<a name="L288"></a><tt class="py-lineno">288</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-227" class="py-name"><a title="spade.Agent.AbstractAgent.DEBUG
spade.spade_backend.SpadeBackend.DEBUG
spade.xmpp.client.PlugIn.DEBUG
spade.xmpp.simplexml.NodeBuilder.DEBUG
spade.xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-227', 'DEBUG', 'link-28');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">'Successfully authenticated with remote server.'</tt><tt class="py-op">,</tt><tt class="py-string">'ok'</tt><tt class="py-op">)</tt> </tt>
<a name="L289"></a><tt class="py-lineno">289</tt>  <tt class="py-line">            <tt id="link-228" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-228', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-229" class="py-name"><a title="spade.xmpp.session.Session.StartStream
spade.xmppd.xmppd.Session.StartStream" class="py-name" href="#" onclick="return doclink('link-229', 'StartStream', 'link-84');">StartStream</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L290"></a><tt class="py-lineno">290</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">stanza</tt><tt class="py-op">.</tt><tt id="link-230" class="py-name"><a title="spade.AID.aid.getName
spade.Agent.AbstractAgent.getName
spade.DF.DfAgentDescription.getName
spade.DF.Service.getName
spade.DF.ServiceDescription.getName
spade.pyparsing.ParseResults.getName
spade.xmpp.roster.Roster.getName
spade.xmpp.simplexml.Node.getName
spade.xmppd.modules.muc.Room.getName
spade.xmppd.modules.wq.Group.getName
spade.xmppd.xmppd.Session.getName" class="py-name" href="#" onclick="return doclink('link-230', 'getName', 'link-88');">getName</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">==</tt><tt class="py-string">'failure'</tt><tt class="py-op">:</tt> </tt>
<a name="L291"></a><tt class="py-lineno">291</tt>  <tt class="py-line">            <tt id="link-231" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-231', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">sasl</tt><tt class="py-op">[</tt><tt class="py-string">'next'</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-string">'challenge'</tt><tt class="py-op">,</tt><tt class="py-string">'success'</tt><tt class="py-op">,</tt><tt class="py-string">'failure'</tt><tt class="py-op">]</tt> </tt>
<a name="L292"></a><tt class="py-lineno">292</tt>  <tt class="py-line">            <tt id="link-232" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-232', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">startsasl</tt><tt class="py-op">=</tt><tt class="py-string">'failure'</tt> </tt>
<a name="L293"></a><tt class="py-lineno">293</tt>  <tt class="py-line">            <tt class="py-keyword">try</tt><tt class="py-op">:</tt> <tt class="py-name">reason</tt><tt class="py-op">=</tt><tt class="py-name">challenge</tt><tt class="py-op">.</tt><tt id="link-233" class="py-name" targets="Method spade.xmpp.simplexml.Node.getChildren()=spade.xmpp.simplexml.Node-class.html#getChildren"><a title="spade.xmpp.simplexml.Node.getChildren" class="py-name" href="#" onclick="return doclink('link-233', 'getChildren', 'link-233');">getChildren</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L294"></a><tt class="py-lineno">294</tt>  <tt class="py-line">            <tt class="py-keyword">except</tt><tt class="py-op">:</tt> <tt class="py-name">reason</tt><tt class="py-op">=</tt><tt class="py-name">challenge</tt> </tt>
<a name="L295"></a><tt class="py-lineno">295</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-234" class="py-name"><a title="spade.Agent.AbstractAgent.DEBUG
spade.spade_backend.SpadeBackend.DEBUG
spade.xmpp.client.PlugIn.DEBUG
spade.xmpp.simplexml.NodeBuilder.DEBUG
spade.xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-234', 'DEBUG', 'link-28');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">'Failed SASL authentification: %s'</tt><tt class="py-op">%</tt><tt class="py-name">reason</tt><tt class="py-op">,</tt><tt class="py-string">'error'</tt><tt class="py-op">)</tt> </tt>
<a name="L296"></a><tt class="py-lineno">296</tt>  <tt class="py-line">        <tt class="py-keyword">raise</tt> <tt id="link-235" class="py-name"><a title="spade.xmpp.protocol.NodeProcessed" class="py-name" href="#" onclick="return doclink('link-235', 'NodeProcessed', 'link-32');">NodeProcessed</a></tt> </tt>
</div></div><a name="L297"></a><tt class="py-lineno">297</tt>  <tt class="py-line"> </tt>
<a name="Bind"></a><div id="Bind-def"><a name="L298"></a><tt class="py-lineno">298</tt> <a class="py-toggle" href="#" id="Bind-toggle" onclick="return toggle('Bind');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="spade.xmppd.modules.stream.Bind-class.html">Bind</a><tt class="py-op">(</tt><tt class="py-base-class">PlugIn</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Bind-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="Bind-expanded"><a name="L299"></a><tt class="py-lineno">299</tt>  <tt class="py-line">    <tt id="link-236" class="py-name"><a title="spade.xmppd.modules.config.Config.NS
spade.xmppd.modules.db_fake.AUTH.NS
spade.xmppd.modules.db_fake.DB.NS
spade.xmppd.modules.dialback.Dialback.NS
spade.xmppd.modules.jep0077.IBR.NS
spade.xmppd.modules.jep0078.NSA.NS
spade.xmppd.modules.message.MessageCatcher.NS
spade.xmppd.modules.muc.MUC.NS
spade.xmppd.modules.oob.OOB.NS
spade.xmppd.modules.pubsub.PubSubServer.NS
spade.xmppd.modules.roster.ROSTER.NS
spade.xmppd.modules.router.Router.NS
spade.xmppd.modules.stream.Bind.NS
spade.xmppd.modules.stream.Handshake.NS
spade.xmppd.modules.stream.SASL.NS
spade.xmppd.modules.stream.Session.NS
spade.xmppd.modules.stream.TLS.NS
spade.xmppd.modules.webadmin.WebAdmin.NS
spade.xmppd.modules.wq.WQ.NS" class="py-name" href="#" onclick="return doclink('link-236', 'NS', 'link-4');">NS</a></tt><tt class="py-op">=</tt><tt id="link-237" class="py-name" targets="Variable spade.Agent.NS_BIND=spade.Agent-module.html#NS_BIND,Variable spade.MTP.NS_BIND=spade.MTP-module.html#NS_BIND,Variable spade.Organization.NS_BIND=spade.Organization-module.html#NS_BIND,Variable spade.Organization_new.NS_BIND=spade.Organization_new-module.html#NS_BIND,Variable spade.Unit.NS_BIND=spade.Unit-module.html#NS_BIND,Variable spade.Unit_new.NS_BIND=spade.Unit_new-module.html#NS_BIND,Variable spade.pubsub.NS_BIND=spade.pubsub-module.html#NS_BIND,Variable spade.socialnetwork.NS_BIND=spade.socialnetwork-module.html#NS_BIND,Variable spade.xmpp.NS_BIND=spade.xmpp-module.html#NS_BIND,Variable spade.xmpp.auth.NS_BIND=spade.xmpp.auth-module.html#NS_BIND,Variable spade.xmpp.browser.NS_BIND=spade.xmpp.browser-module.html#NS_BIND,Variable spade.xmpp.commands.NS_BIND=spade.xmpp.commands-module.html#NS_BIND,Variable spade.xmpp.dispatcher.NS_BIND=spade.xmpp.dispatcher-module.html#NS_BIND,Variable spade.xmpp.features.NS_BIND=spade.xmpp.features-module.html#NS_BIND,Variable spade.xmpp.filetransfer.NS_BIND=spade.xmpp.filetransfer-module.html#NS_BIND,Variable spade.xmpp.protocol.NS_BIND=spade.xmpp.protocol-module.html#NS_BIND,Variable spade.xmpp.roster.NS_BIND=spade.xmpp.roster-module.html#NS_BIND,Variable spade.xmpp.transports.NS_BIND=spade.xmpp.transports-module.html#NS_BIND,Variable spade.xmppd.modules.config.NS_BIND=spade.xmppd.modules.config-module.html#NS_BIND,Variable spade.xmppd.modules.db_fake.NS_BIND=spade.xmppd.modules.db_fake-module.html#NS_BIND,Variable spade.xmppd.modules.dialback.NS_BIND=spade.xmppd.modules.dialback-module.html#NS_BIND,Variable spade.xmppd.modules.jep0077.NS_BIND=spade.xmppd.modules.jep0077-module.html#NS_BIND,Variable spade.xmppd.modules.jep0078.NS_BIND=spade.xmppd.modules.jep0078-module.html#NS_BIND,Variable spade.xmppd.modules.message.NS_BIND=spade.xmppd.modules.message-module.html#NS_BIND,Variable spade.xmppd.modules.muc.NS_BIND=spade.xmppd.modules.muc-module.html#NS_BIND,Variable spade.xmppd.modules.oob.NS_BIND=spade.xmppd.modules.oob-module.html#NS_BIND,Variable spade.xmppd.modules.pubsub.NS_BIND=spade.xmppd.modules.pubsub-module.html#NS_BIND,Variable spade.xmppd.modules.roster.NS_BIND=spade.xmppd.modules.roster-module.html#NS_BIND,Variable spade.xmppd.modules.router.NS_BIND=spade.xmppd.modules.router-module.html#NS_BIND,Variable spade.xmppd.modules.stream.NS_BIND=spade.xmppd.modules.stream-module.html#NS_BIND,Variable spade.xmppd.modules.webadmin.NS_BIND=spade.xmppd.modules.webadmin-module.html#NS_BIND,Variable spade.xmppd.modules.wq.NS_BIND=spade.xmppd.modules.wq-module.html#NS_BIND,Variable spade.xmppd.xmppd.NS_BIND=spade.xmppd.xmppd-module.html#NS_BIND"><a title="spade.Agent.NS_BIND
spade.MTP.NS_BIND
spade.Organization.NS_BIND
spade.Organization_new.NS_BIND
spade.Unit.NS_BIND
spade.Unit_new.NS_BIND
spade.pubsub.NS_BIND
spade.socialnetwork.NS_BIND
spade.xmpp.NS_BIND
spade.xmpp.auth.NS_BIND
spade.xmpp.browser.NS_BIND
spade.xmpp.commands.NS_BIND
spade.xmpp.dispatcher.NS_BIND
spade.xmpp.features.NS_BIND
spade.xmpp.filetransfer.NS_BIND
spade.xmpp.protocol.NS_BIND
spade.xmpp.roster.NS_BIND
spade.xmpp.transports.NS_BIND
spade.xmppd.modules.config.NS_BIND
spade.xmppd.modules.db_fake.NS_BIND
spade.xmppd.modules.dialback.NS_BIND
spade.xmppd.modules.jep0077.NS_BIND
spade.xmppd.modules.jep0078.NS_BIND
spade.xmppd.modules.message.NS_BIND
spade.xmppd.modules.muc.NS_BIND
spade.xmppd.modules.oob.NS_BIND
spade.xmppd.modules.pubsub.NS_BIND
spade.xmppd.modules.roster.NS_BIND
spade.xmppd.modules.router.NS_BIND
spade.xmppd.modules.stream.NS_BIND
spade.xmppd.modules.webadmin.NS_BIND
spade.xmppd.modules.wq.NS_BIND
spade.xmppd.xmppd.NS_BIND" class="py-name" href="#" onclick="return doclink('link-237', 'NS_BIND', 'link-237');">NS_BIND</a></tt> </tt>
<a name="Bind.plugin"></a><div id="Bind.plugin-def"><a name="L300"></a><tt class="py-lineno">300</tt> <a class="py-toggle" href="#" id="Bind.plugin-toggle" onclick="return toggle('Bind.plugin');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="spade.xmppd.modules.stream.Bind-class.html#plugin">plugin</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">server</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Bind.plugin-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Bind.plugin-expanded"><a name="L301"></a><tt class="py-lineno">301</tt>  <tt class="py-line">        <tt class="py-name">server</tt><tt class="py-op">.</tt><tt id="link-238" class="py-name"><a title="spade.xmpp.dispatcher.Dispatcher" class="py-name" href="#" onclick="return doclink('link-238', 'Dispatcher', 'link-6');">Dispatcher</a></tt><tt class="py-op">.</tt><tt id="link-239" class="py-name"><a title="spade.xmpp.dispatcher.Dispatcher.RegisterHandler" class="py-name" href="#" onclick="return doclink('link-239', 'RegisterHandler', 'link-7');">RegisterHandler</a></tt><tt class="py-op">(</tt><tt class="py-string">'iq'</tt><tt class="py-op">,</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-240" class="py-name" targets="Method spade.xmppd.modules.stream.Bind.bindHandler()=spade.xmppd.modules.stream.Bind-class.html#bindHandler"><a title="spade.xmppd.modules.stream.Bind.bindHandler" class="py-name" href="#" onclick="return doclink('link-240', 'bindHandler', 'link-240');">bindHandler</a></tt><tt class="py-op">,</tt><tt class="py-name">typ</tt><tt class="py-op">=</tt><tt class="py-string">'set'</tt><tt class="py-op">,</tt><tt class="py-name">ns</tt><tt class="py-op">=</tt><tt id="link-241" class="py-name"><a title="spade.Agent.NS_BIND
spade.MTP.NS_BIND
spade.Organization.NS_BIND
spade.Organization_new.NS_BIND
spade.Unit.NS_BIND
spade.Unit_new.NS_BIND
spade.pubsub.NS_BIND
spade.socialnetwork.NS_BIND
spade.xmpp.NS_BIND
spade.xmpp.auth.NS_BIND
spade.xmpp.browser.NS_BIND
spade.xmpp.commands.NS_BIND
spade.xmpp.dispatcher.NS_BIND
spade.xmpp.features.NS_BIND
spade.xmpp.filetransfer.NS_BIND
spade.xmpp.protocol.NS_BIND
spade.xmpp.roster.NS_BIND
spade.xmpp.transports.NS_BIND
spade.xmppd.modules.config.NS_BIND
spade.xmppd.modules.db_fake.NS_BIND
spade.xmppd.modules.dialback.NS_BIND
spade.xmppd.modules.jep0077.NS_BIND
spade.xmppd.modules.jep0078.NS_BIND
spade.xmppd.modules.message.NS_BIND
spade.xmppd.modules.muc.NS_BIND
spade.xmppd.modules.oob.NS_BIND
spade.xmppd.modules.pubsub.NS_BIND
spade.xmppd.modules.roster.NS_BIND
spade.xmppd.modules.router.NS_BIND
spade.xmppd.modules.stream.NS_BIND
spade.xmppd.modules.webadmin.NS_BIND
spade.xmppd.modules.wq.NS_BIND
spade.xmppd.xmppd.NS_BIND" class="py-name" href="#" onclick="return doclink('link-241', 'NS_BIND', 'link-237');">NS_BIND</a></tt><tt class="py-op">,</tt><tt class="py-name">xmlns</tt><tt class="py-op">=</tt><tt id="link-242" class="py-name"><a title="spade.Agent.NS_CLIENT
spade.MTP.NS_CLIENT
spade.Organization.NS_CLIENT
spade.Organization_new.NS_CLIENT
spade.Unit.NS_CLIENT
spade.Unit_new.NS_CLIENT
spade.pubsub.NS_CLIENT
spade.socialnetwork.NS_CLIENT
spade.xmpp.NS_CLIENT
spade.xmpp.auth.NS_CLIENT
spade.xmpp.browser.NS_CLIENT
spade.xmpp.commands.NS_CLIENT
spade.xmpp.dispatcher.NS_CLIENT
spade.xmpp.features.NS_CLIENT
spade.xmpp.filetransfer.NS_CLIENT
spade.xmpp.protocol.NS_CLIENT
spade.xmpp.roster.NS_CLIENT
spade.xmpp.transports.NS_CLIENT
spade.xmppd.modules.config.NS_CLIENT
spade.xmppd.modules.db_fake.NS_CLIENT
spade.xmppd.modules.dialback.NS_CLIENT
spade.xmppd.modules.jep0077.NS_CLIENT
spade.xmppd.modules.jep0078.NS_CLIENT
spade.xmppd.modules.message.NS_CLIENT
spade.xmppd.modules.muc.NS_CLIENT
spade.xmppd.modules.oob.NS_CLIENT
spade.xmppd.modules.pubsub.NS_CLIENT
spade.xmppd.modules.roster.NS_CLIENT
spade.xmppd.modules.router.NS_CLIENT
spade.xmppd.modules.stream.NS_CLIENT
spade.xmppd.modules.webadmin.NS_CLIENT
spade.xmppd.modules.wq.NS_CLIENT
spade.xmppd.xmppd.NS_CLIENT" class="py-name" href="#" onclick="return doclink('link-242', 'NS_CLIENT', 'link-154');">NS_CLIENT</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L302"></a><tt class="py-lineno">302</tt>  <tt class="py-line"> </tt>
<a name="Bind.bindHandler"></a><div id="Bind.bindHandler-def"><a name="L303"></a><tt class="py-lineno">303</tt> <a class="py-toggle" href="#" id="Bind.bindHandler-toggle" onclick="return toggle('Bind.bindHandler');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="spade.xmppd.modules.stream.Bind-class.html#bindHandler">bindHandler</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">session</tt><tt class="py-op">,</tt><tt class="py-param">stanza</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Bind.bindHandler-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Bind.bindHandler-expanded"><a name="L304"></a><tt class="py-lineno">304</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-243" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-243', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">xmlns</tt><tt class="py-op">&lt;&gt;</tt><tt id="link-244" class="py-name"><a title="spade.Agent.NS_CLIENT
spade.MTP.NS_CLIENT
spade.Organization.NS_CLIENT
spade.Organization_new.NS_CLIENT
spade.Unit.NS_CLIENT
spade.Unit_new.NS_CLIENT
spade.pubsub.NS_CLIENT
spade.socialnetwork.NS_CLIENT
spade.xmpp.NS_CLIENT
spade.xmpp.auth.NS_CLIENT
spade.xmpp.browser.NS_CLIENT
spade.xmpp.commands.NS_CLIENT
spade.xmpp.dispatcher.NS_CLIENT
spade.xmpp.features.NS_CLIENT
spade.xmpp.filetransfer.NS_CLIENT
spade.xmpp.protocol.NS_CLIENT
spade.xmpp.roster.NS_CLIENT
spade.xmpp.transports.NS_CLIENT
spade.xmppd.modules.config.NS_CLIENT
spade.xmppd.modules.db_fake.NS_CLIENT
spade.xmppd.modules.dialback.NS_CLIENT
spade.xmppd.modules.jep0077.NS_CLIENT
spade.xmppd.modules.jep0078.NS_CLIENT
spade.xmppd.modules.message.NS_CLIENT
spade.xmppd.modules.muc.NS_CLIENT
spade.xmppd.modules.oob.NS_CLIENT
spade.xmppd.modules.pubsub.NS_CLIENT
spade.xmppd.modules.roster.NS_CLIENT
spade.xmppd.modules.router.NS_CLIENT
spade.xmppd.modules.stream.NS_CLIENT
spade.xmppd.modules.webadmin.NS_CLIENT
spade.xmppd.modules.wq.NS_CLIENT
spade.xmppd.xmppd.NS_CLIENT" class="py-name" href="#" onclick="return doclink('link-244', 'NS_CLIENT', 'link-154');">NS_CLIENT</a></tt> <tt class="py-keyword">or</tt> <tt id="link-245" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-245', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">__dict__</tt><tt class="py-op">.</tt><tt class="py-name">has_key</tt><tt class="py-op">(</tt><tt class="py-string">'resource'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L305"></a><tt class="py-lineno">305</tt>  <tt class="py-line">            <tt id="link-246" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-246', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-247" class="py-name"><a title="spade.Agent.AbstractAgent.send
spade.MTP.MTP.send
spade.xmpp.dispatcher.Dispatcher.send
spade.xmpp.transports.TCPsocket.send
spade.xmppd.xmppd.RPC_Client.send
spade.xmppd.xmppd.Session.send" class="py-name" href="#" onclick="return doclink('link-247', 'send', 'link-25');">send</a></tt><tt class="py-op">(</tt><tt id="link-248" class="py-name" targets="Class spade.xmpp.protocol.Error=spade.xmpp.protocol.Error-class.html"><a title="spade.xmpp.protocol.Error" class="py-name" href="#" onclick="return doclink('link-248', 'Error', 'link-248');">Error</a></tt><tt class="py-op">(</tt><tt class="py-name">stanza</tt><tt class="py-op">,</tt><tt id="link-249" class="py-name" targets="Variable spade.Agent.ERR_SERVICE_UNAVAILABLE=spade.Agent-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.MTP.ERR_SERVICE_UNAVAILABLE=spade.MTP-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.Organization.ERR_SERVICE_UNAVAILABLE=spade.Organization-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.Organization_new.ERR_SERVICE_UNAVAILABLE=spade.Organization_new-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.Unit.ERR_SERVICE_UNAVAILABLE=spade.Unit-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.Unit_new.ERR_SERVICE_UNAVAILABLE=spade.Unit_new-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.pubsub.ERR_SERVICE_UNAVAILABLE=spade.pubsub-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.socialnetwork.ERR_SERVICE_UNAVAILABLE=spade.socialnetwork-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmpp.ERR_SERVICE_UNAVAILABLE=spade.xmpp-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmpp.auth.ERR_SERVICE_UNAVAILABLE=spade.xmpp.auth-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmpp.browser.ERR_SERVICE_UNAVAILABLE=spade.xmpp.browser-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmpp.commands.ERR_SERVICE_UNAVAILABLE=spade.xmpp.commands-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmpp.dispatcher.ERR_SERVICE_UNAVAILABLE=spade.xmpp.dispatcher-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmpp.features.ERR_SERVICE_UNAVAILABLE=spade.xmpp.features-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmpp.filetransfer.ERR_SERVICE_UNAVAILABLE=spade.xmpp.filetransfer-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmpp.protocol.ERR_SERVICE_UNAVAILABLE=spade.xmpp.protocol-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmpp.roster.ERR_SERVICE_UNAVAILABLE=spade.xmpp.roster-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmpp.transports.ERR_SERVICE_UNAVAILABLE=spade.xmpp.transports-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmppd.modules.config.ERR_SERVICE_UNAVAILABLE=spade.xmppd.modules.config-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmppd.modules.db_fake.ERR_SERVICE_UNAVAILABLE=spade.xmppd.modules.db_fake-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmppd.modules.dialback.ERR_SERVICE_UNAVAILABLE=spade.xmppd.modules.dialback-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmppd.modules.jep0077.ERR_SERVICE_UNAVAILABLE=spade.xmppd.modules.jep0077-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmppd.modules.jep0078.ERR_SERVICE_UNAVAILABLE=spade.xmppd.modules.jep0078-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmppd.modules.message.ERR_SERVICE_UNAVAILABLE=spade.xmppd.modules.message-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmppd.modules.muc.ERR_SERVICE_UNAVAILABLE=spade.xmppd.modules.muc-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmppd.modules.oob.ERR_SERVICE_UNAVAILABLE=spade.xmppd.modules.oob-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmppd.modules.pubsub.ERR_SERVICE_UNAVAILABLE=spade.xmppd.modules.pubsub-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmppd.modules.roster.ERR_SERVICE_UNAVAILABLE=spade.xmppd.modules.roster-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmppd.modules.router.ERR_SERVICE_UNAVAILABLE=spade.xmppd.modules.router-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmppd.modules.stream.ERR_SERVICE_UNAVAILABLE=spade.xmppd.modules.stream-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmppd.modules.webadmin.ERR_SERVICE_UNAVAILABLE=spade.xmppd.modules.webadmin-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmppd.modules.wq.ERR_SERVICE_UNAVAILABLE=spade.xmppd.modules.wq-module.html#ERR_SERVICE_UNAVAILABLE,Variable spade.xmppd.xmppd.ERR_SERVICE_UNAVAILABLE=spade.xmppd.xmppd-module.html#ERR_SERVICE_UNAVAILABLE"><a title="spade.Agent.ERR_SERVICE_UNAVAILABLE
spade.MTP.ERR_SERVICE_UNAVAILABLE
spade.Organization.ERR_SERVICE_UNAVAILABLE
spade.Organization_new.ERR_SERVICE_UNAVAILABLE
spade.Unit.ERR_SERVICE_UNAVAILABLE
spade.Unit_new.ERR_SERVICE_UNAVAILABLE
spade.pubsub.ERR_SERVICE_UNAVAILABLE
spade.socialnetwork.ERR_SERVICE_UNAVAILABLE
spade.xmpp.ERR_SERVICE_UNAVAILABLE
spade.xmpp.auth.ERR_SERVICE_UNAVAILABLE
spade.xmpp.browser.ERR_SERVICE_UNAVAILABLE
spade.xmpp.commands.ERR_SERVICE_UNAVAILABLE
spade.xmpp.dispatcher.ERR_SERVICE_UNAVAILABLE
spade.xmpp.features.ERR_SERVICE_UNAVAILABLE
spade.xmpp.filetransfer.ERR_SERVICE_UNAVAILABLE
spade.xmpp.protocol.ERR_SERVICE_UNAVAILABLE
spade.xmpp.roster.ERR_SERVICE_UNAVAILABLE
spade.xmpp.transports.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.config.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.db_fake.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.dialback.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.jep0077.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.jep0078.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.message.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.muc.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.oob.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.pubsub.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.roster.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.router.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.stream.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.webadmin.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.wq.ERR_SERVICE_UNAVAILABLE
spade.xmppd.xmppd.ERR_SERVICE_UNAVAILABLE" class="py-name" href="#" onclick="return doclink('link-249', 'ERR_SERVICE_UNAVAILABLE', 'link-249');">ERR_SERVICE_UNAVAILABLE</a></tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L306"></a><tt class="py-lineno">306</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L307"></a><tt class="py-lineno">307</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt id="link-250" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-250', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">_session_state</tt><tt class="py-op">&lt;</tt><tt id="link-251" class="py-name"><a title="spade.xmpp.session.SESSION_AUTHED
spade.xmppd.modules.router.SESSION_AUTHED
spade.xmppd.modules.stream.SESSION_AUTHED
spade.xmppd.xmppd.SESSION_AUTHED" class="py-name" href="#" onclick="return doclink('link-251', 'SESSION_AUTHED', 'link-157');">SESSION_AUTHED</a></tt><tt class="py-op">:</tt> </tt>
<a name="L308"></a><tt class="py-lineno">308</tt>  <tt class="py-line">                <tt id="link-252" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-252', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-253" class="py-name"><a title="spade.xmpp.session.Session.terminate_stream
spade.xmppd.xmppd.Session.terminate_stream" class="py-name" href="#" onclick="return doclink('link-253', 'terminate_stream', 'link-66');">terminate_stream</a></tt><tt class="py-op">(</tt><tt id="link-254" class="py-name" targets="Variable spade.Agent.STREAM_NOT_AUTHORIZED=spade.Agent-module.html#STREAM_NOT_AUTHORIZED,Variable spade.MTP.STREAM_NOT_AUTHORIZED=spade.MTP-module.html#STREAM_NOT_AUTHORIZED,Variable spade.Organization.STREAM_NOT_AUTHORIZED=spade.Organization-module.html#STREAM_NOT_AUTHORIZED,Variable spade.Organization_new.STREAM_NOT_AUTHORIZED=spade.Organization_new-module.html#STREAM_NOT_AUTHORIZED,Variable spade.Unit.STREAM_NOT_AUTHORIZED=spade.Unit-module.html#STREAM_NOT_AUTHORIZED,Variable spade.Unit_new.STREAM_NOT_AUTHORIZED=spade.Unit_new-module.html#STREAM_NOT_AUTHORIZED,Variable spade.pubsub.STREAM_NOT_AUTHORIZED=spade.pubsub-module.html#STREAM_NOT_AUTHORIZED,Variable spade.socialnetwork.STREAM_NOT_AUTHORIZED=spade.socialnetwork-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmpp.STREAM_NOT_AUTHORIZED=spade.xmpp-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmpp.auth.STREAM_NOT_AUTHORIZED=spade.xmpp.auth-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmpp.browser.STREAM_NOT_AUTHORIZED=spade.xmpp.browser-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmpp.commands.STREAM_NOT_AUTHORIZED=spade.xmpp.commands-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmpp.dispatcher.STREAM_NOT_AUTHORIZED=spade.xmpp.dispatcher-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmpp.features.STREAM_NOT_AUTHORIZED=spade.xmpp.features-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmpp.filetransfer.STREAM_NOT_AUTHORIZED=spade.xmpp.filetransfer-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmpp.protocol.STREAM_NOT_AUTHORIZED=spade.xmpp.protocol-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmpp.roster.STREAM_NOT_AUTHORIZED=spade.xmpp.roster-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmpp.transports.STREAM_NOT_AUTHORIZED=spade.xmpp.transports-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmppd.modules.config.STREAM_NOT_AUTHORIZED=spade.xmppd.modules.config-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmppd.modules.db_fake.STREAM_NOT_AUTHORIZED=spade.xmppd.modules.db_fake-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmppd.modules.dialback.STREAM_NOT_AUTHORIZED=spade.xmppd.modules.dialback-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmppd.modules.jep0077.STREAM_NOT_AUTHORIZED=spade.xmppd.modules.jep0077-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmppd.modules.jep0078.STREAM_NOT_AUTHORIZED=spade.xmppd.modules.jep0078-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmppd.modules.message.STREAM_NOT_AUTHORIZED=spade.xmppd.modules.message-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmppd.modules.muc.STREAM_NOT_AUTHORIZED=spade.xmppd.modules.muc-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmppd.modules.oob.STREAM_NOT_AUTHORIZED=spade.xmppd.modules.oob-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmppd.modules.pubsub.STREAM_NOT_AUTHORIZED=spade.xmppd.modules.pubsub-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmppd.modules.roster.STREAM_NOT_AUTHORIZED=spade.xmppd.modules.roster-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmppd.modules.router.STREAM_NOT_AUTHORIZED=spade.xmppd.modules.router-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmppd.modules.stream.STREAM_NOT_AUTHORIZED=spade.xmppd.modules.stream-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmppd.modules.webadmin.STREAM_NOT_AUTHORIZED=spade.xmppd.modules.webadmin-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmppd.modules.wq.STREAM_NOT_AUTHORIZED=spade.xmppd.modules.wq-module.html#STREAM_NOT_AUTHORIZED,Variable spade.xmppd.xmppd.STREAM_NOT_AUTHORIZED=spade.xmppd.xmppd-module.html#STREAM_NOT_AUTHORIZED"><a title="spade.Agent.STREAM_NOT_AUTHORIZED
spade.MTP.STREAM_NOT_AUTHORIZED
spade.Organization.STREAM_NOT_AUTHORIZED
spade.Organization_new.STREAM_NOT_AUTHORIZED
spade.Unit.STREAM_NOT_AUTHORIZED
spade.Unit_new.STREAM_NOT_AUTHORIZED
spade.pubsub.STREAM_NOT_AUTHORIZED
spade.socialnetwork.STREAM_NOT_AUTHORIZED
spade.xmpp.STREAM_NOT_AUTHORIZED
spade.xmpp.auth.STREAM_NOT_AUTHORIZED
spade.xmpp.browser.STREAM_NOT_AUTHORIZED
spade.xmpp.commands.STREAM_NOT_AUTHORIZED
spade.xmpp.dispatcher.STREAM_NOT_AUTHORIZED
spade.xmpp.features.STREAM_NOT_AUTHORIZED
spade.xmpp.filetransfer.STREAM_NOT_AUTHORIZED
spade.xmpp.protocol.STREAM_NOT_AUTHORIZED
spade.xmpp.roster.STREAM_NOT_AUTHORIZED
spade.xmpp.transports.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.config.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.db_fake.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.dialback.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.jep0077.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.jep0078.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.message.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.muc.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.oob.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.pubsub.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.roster.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.router.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.stream.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.webadmin.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.wq.STREAM_NOT_AUTHORIZED
spade.xmppd.xmppd.STREAM_NOT_AUTHORIZED" class="py-name" href="#" onclick="return doclink('link-254', 'STREAM_NOT_AUTHORIZED', 'link-254');">STREAM_NOT_AUTHORIZED</a></tt><tt class="py-op">)</tt> </tt>
<a name="L309"></a><tt class="py-lineno">309</tt>  <tt class="py-line">                <tt class="py-keyword">raise</tt> <tt id="link-255" class="py-name"><a title="spade.xmpp.protocol.NodeProcessed" class="py-name" href="#" onclick="return doclink('link-255', 'NodeProcessed', 'link-32');">NodeProcessed</a></tt> </tt>
<a name="L310"></a><tt class="py-lineno">310</tt>  <tt class="py-line">            <tt class="py-name">resource</tt><tt class="py-op">=</tt><tt class="py-name">stanza</tt><tt class="py-op">.</tt><tt id="link-256" class="py-name"><a title="spade.xmpp.simplexml.Node.getTag" class="py-name" href="#" onclick="return doclink('link-256', 'getTag', 'link-121');">getTag</a></tt><tt class="py-op">(</tt><tt class="py-string">'bind'</tt><tt class="py-op">,</tt><tt class="py-name">namespace</tt><tt class="py-op">=</tt><tt id="link-257" class="py-name"><a title="spade.Agent.NS_BIND
spade.MTP.NS_BIND
spade.Organization.NS_BIND
spade.Organization_new.NS_BIND
spade.Unit.NS_BIND
spade.Unit_new.NS_BIND
spade.pubsub.NS_BIND
spade.socialnetwork.NS_BIND
spade.xmpp.NS_BIND
spade.xmpp.auth.NS_BIND
spade.xmpp.browser.NS_BIND
spade.xmpp.commands.NS_BIND
spade.xmpp.dispatcher.NS_BIND
spade.xmpp.features.NS_BIND
spade.xmpp.filetransfer.NS_BIND
spade.xmpp.protocol.NS_BIND
spade.xmpp.roster.NS_BIND
spade.xmpp.transports.NS_BIND
spade.xmppd.modules.config.NS_BIND
spade.xmppd.modules.db_fake.NS_BIND
spade.xmppd.modules.dialback.NS_BIND
spade.xmppd.modules.jep0077.NS_BIND
spade.xmppd.modules.jep0078.NS_BIND
spade.xmppd.modules.message.NS_BIND
spade.xmppd.modules.muc.NS_BIND
spade.xmppd.modules.oob.NS_BIND
spade.xmppd.modules.pubsub.NS_BIND
spade.xmppd.modules.roster.NS_BIND
spade.xmppd.modules.router.NS_BIND
spade.xmppd.modules.stream.NS_BIND
spade.xmppd.modules.webadmin.NS_BIND
spade.xmppd.modules.wq.NS_BIND
spade.xmppd.xmppd.NS_BIND" class="py-name" href="#" onclick="return doclink('link-257', 'NS_BIND', 'link-237');">NS_BIND</a></tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt id="link-258" class="py-name" targets="Class spade.xmpp.simplexml.T=spade.xmpp.simplexml.T-class.html"><a title="spade.xmpp.simplexml.T" class="py-name" href="#" onclick="return doclink('link-258', 'T', 'link-258');">T</a></tt><tt class="py-op">.</tt><tt class="py-name">resource</tt><tt class="py-op">.</tt><tt id="link-259" class="py-name"><a title="spade.xmpp.simplexml.Node.getData" class="py-name" href="#" onclick="return doclink('link-259', 'getData', 'link-193');">getData</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L311"></a><tt class="py-lineno">311</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">resource</tt><tt class="py-op">:</tt> <tt class="py-name">resource</tt><tt class="py-op">=</tt><tt id="link-260" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-260', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-261" class="py-name" targets="Variable spade.xmpp.browser.ID=spade.xmpp.browser-module.html#ID,Variable spade.xmpp.dispatcher.ID=spade.xmpp.dispatcher-module.html#ID"><a title="spade.xmpp.browser.ID
spade.xmpp.dispatcher.ID" class="py-name" href="#" onclick="return doclink('link-261', 'ID', 'link-261');">ID</a></tt> </tt>
<a name="L312"></a><tt class="py-lineno">312</tt>  <tt class="py-line">            <tt class="py-name">fulljid</tt><tt class="py-op">=</tt><tt class="py-string">"%s/%s"</tt><tt class="py-op">%</tt><tt class="py-op">(</tt><tt id="link-262" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-262', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">peer</tt><tt class="py-op">,</tt><tt class="py-name">resource</tt><tt class="py-op">)</tt> </tt>
<a name="L313"></a><tt class="py-lineno">313</tt>  <tt class="py-line">            <tt id="link-263" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-263', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">peer</tt><tt class="py-op">=</tt><tt class="py-name">fulljid</tt> </tt>
<a name="L314"></a><tt class="py-lineno">314</tt>  <tt class="py-line">            <tt class="py-name">s</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt id="link-264" class="py-name" targets="Method spade.xmppd.xmppd.Server.deactivatesession()=spade.xmppd.xmppd.Server-class.html#deactivatesession"><a title="spade.xmppd.xmppd.Server.deactivatesession" class="py-name" href="#" onclick="return doclink('link-264', 'deactivatesession', 'link-264');">deactivatesession</a></tt><tt class="py-op">(</tt><tt class="py-name">fulljid</tt><tt class="py-op">)</tt> </tt>
<a name="L315"></a><tt class="py-lineno">315</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">s</tt><tt class="py-op">:</tt> <tt class="py-name">s</tt><tt class="py-op">.</tt><tt id="link-265" class="py-name"><a title="spade.xmpp.session.Session.terminate_stream
spade.xmppd.xmppd.Session.terminate_stream" class="py-name" href="#" onclick="return doclink('link-265', 'terminate_stream', 'link-66');">terminate_stream</a></tt><tt class="py-op">(</tt><tt id="link-266" class="py-name" targets="Variable spade.Agent.STREAM_CONFLICT=spade.Agent-module.html#STREAM_CONFLICT,Variable spade.MTP.STREAM_CONFLICT=spade.MTP-module.html#STREAM_CONFLICT,Variable spade.Organization.STREAM_CONFLICT=spade.Organization-module.html#STREAM_CONFLICT,Variable spade.Organization_new.STREAM_CONFLICT=spade.Organization_new-module.html#STREAM_CONFLICT,Variable spade.Unit.STREAM_CONFLICT=spade.Unit-module.html#STREAM_CONFLICT,Variable spade.Unit_new.STREAM_CONFLICT=spade.Unit_new-module.html#STREAM_CONFLICT,Variable spade.pubsub.STREAM_CONFLICT=spade.pubsub-module.html#STREAM_CONFLICT,Variable spade.socialnetwork.STREAM_CONFLICT=spade.socialnetwork-module.html#STREAM_CONFLICT,Variable spade.xmpp.STREAM_CONFLICT=spade.xmpp-module.html#STREAM_CONFLICT,Variable spade.xmpp.auth.STREAM_CONFLICT=spade.xmpp.auth-module.html#STREAM_CONFLICT,Variable spade.xmpp.browser.STREAM_CONFLICT=spade.xmpp.browser-module.html#STREAM_CONFLICT,Variable spade.xmpp.commands.STREAM_CONFLICT=spade.xmpp.commands-module.html#STREAM_CONFLICT,Variable spade.xmpp.dispatcher.STREAM_CONFLICT=spade.xmpp.dispatcher-module.html#STREAM_CONFLICT,Variable spade.xmpp.features.STREAM_CONFLICT=spade.xmpp.features-module.html#STREAM_CONFLICT,Variable spade.xmpp.filetransfer.STREAM_CONFLICT=spade.xmpp.filetransfer-module.html#STREAM_CONFLICT,Variable spade.xmpp.protocol.STREAM_CONFLICT=spade.xmpp.protocol-module.html#STREAM_CONFLICT,Variable spade.xmpp.roster.STREAM_CONFLICT=spade.xmpp.roster-module.html#STREAM_CONFLICT,Variable spade.xmpp.transports.STREAM_CONFLICT=spade.xmpp.transports-module.html#STREAM_CONFLICT,Variable spade.xmppd.modules.config.STREAM_CONFLICT=spade.xmppd.modules.config-module.html#STREAM_CONFLICT,Variable spade.xmppd.modules.db_fake.STREAM_CONFLICT=spade.xmppd.modules.db_fake-module.html#STREAM_CONFLICT,Variable spade.xmppd.modules.dialback.STREAM_CONFLICT=spade.xmppd.modules.dialback-module.html#STREAM_CONFLICT,Variable spade.xmppd.modules.jep0077.STREAM_CONFLICT=spade.xmppd.modules.jep0077-module.html#STREAM_CONFLICT,Variable spade.xmppd.modules.jep0078.STREAM_CONFLICT=spade.xmppd.modules.jep0078-module.html#STREAM_CONFLICT,Variable spade.xmppd.modules.message.STREAM_CONFLICT=spade.xmppd.modules.message-module.html#STREAM_CONFLICT,Variable spade.xmppd.modules.muc.STREAM_CONFLICT=spade.xmppd.modules.muc-module.html#STREAM_CONFLICT,Variable spade.xmppd.modules.oob.STREAM_CONFLICT=spade.xmppd.modules.oob-module.html#STREAM_CONFLICT,Variable spade.xmppd.modules.pubsub.STREAM_CONFLICT=spade.xmppd.modules.pubsub-module.html#STREAM_CONFLICT,Variable spade.xmppd.modules.roster.STREAM_CONFLICT=spade.xmppd.modules.roster-module.html#STREAM_CONFLICT,Variable spade.xmppd.modules.router.STREAM_CONFLICT=spade.xmppd.modules.router-module.html#STREAM_CONFLICT,Variable spade.xmppd.modules.stream.STREAM_CONFLICT=spade.xmppd.modules.stream-module.html#STREAM_CONFLICT,Variable spade.xmppd.modules.webadmin.STREAM_CONFLICT=spade.xmppd.modules.webadmin-module.html#STREAM_CONFLICT,Variable spade.xmppd.modules.wq.STREAM_CONFLICT=spade.xmppd.modules.wq-module.html#STREAM_CONFLICT,Variable spade.xmppd.xmppd.STREAM_CONFLICT=spade.xmppd.xmppd-module.html#STREAM_CONFLICT"><a title="spade.Agent.STREAM_CONFLICT
spade.MTP.STREAM_CONFLICT
spade.Organization.STREAM_CONFLICT
spade.Organization_new.STREAM_CONFLICT
spade.Unit.STREAM_CONFLICT
spade.Unit_new.STREAM_CONFLICT
spade.pubsub.STREAM_CONFLICT
spade.socialnetwork.STREAM_CONFLICT
spade.xmpp.STREAM_CONFLICT
spade.xmpp.auth.STREAM_CONFLICT
spade.xmpp.browser.STREAM_CONFLICT
spade.xmpp.commands.STREAM_CONFLICT
spade.xmpp.dispatcher.STREAM_CONFLICT
spade.xmpp.features.STREAM_CONFLICT
spade.xmpp.filetransfer.STREAM_CONFLICT
spade.xmpp.protocol.STREAM_CONFLICT
spade.xmpp.roster.STREAM_CONFLICT
spade.xmpp.transports.STREAM_CONFLICT
spade.xmppd.modules.config.STREAM_CONFLICT
spade.xmppd.modules.db_fake.STREAM_CONFLICT
spade.xmppd.modules.dialback.STREAM_CONFLICT
spade.xmppd.modules.jep0077.STREAM_CONFLICT
spade.xmppd.modules.jep0078.STREAM_CONFLICT
spade.xmppd.modules.message.STREAM_CONFLICT
spade.xmppd.modules.muc.STREAM_CONFLICT
spade.xmppd.modules.oob.STREAM_CONFLICT
spade.xmppd.modules.pubsub.STREAM_CONFLICT
spade.xmppd.modules.roster.STREAM_CONFLICT
spade.xmppd.modules.router.STREAM_CONFLICT
spade.xmppd.modules.stream.STREAM_CONFLICT
spade.xmppd.modules.webadmin.STREAM_CONFLICT
spade.xmppd.modules.wq.STREAM_CONFLICT
spade.xmppd.xmppd.STREAM_CONFLICT" class="py-name" href="#" onclick="return doclink('link-266', 'STREAM_CONFLICT', 'link-266');">STREAM_CONFLICT</a></tt><tt class="py-op">)</tt> </tt>
<a name="L316"></a><tt class="py-lineno">316</tt>  <tt class="py-line">            <tt class="py-name">rep</tt><tt class="py-op">=</tt><tt class="py-name">stanza</tt><tt class="py-op">.</tt><tt id="link-267" class="py-name" targets="Method spade.xmpp.protocol.Iq.buildReply()=spade.xmpp.protocol.Iq-class.html#buildReply,Method spade.xmpp.protocol.Message.buildReply()=spade.xmpp.protocol.Message-class.html#buildReply"><a title="spade.xmpp.protocol.Iq.buildReply
spade.xmpp.protocol.Message.buildReply" class="py-name" href="#" onclick="return doclink('link-267', 'buildReply', 'link-267');">buildReply</a></tt><tt class="py-op">(</tt><tt class="py-string">'result'</tt><tt class="py-op">)</tt> </tt>
<a name="L317"></a><tt class="py-lineno">317</tt>  <tt class="py-line">            <tt class="py-name">rep</tt><tt class="py-op">.</tt><tt id="link-268" class="py-name" targets="Class spade.xmpp.simplexml.NT=spade.xmpp.simplexml.NT-class.html"><a title="spade.xmpp.simplexml.NT" class="py-name" href="#" onclick="return doclink('link-268', 'NT', 'link-268');">NT</a></tt><tt class="py-op">.</tt><tt class="py-name">bind</tt><tt class="py-op">.</tt><tt id="link-269" class="py-name" targets="Method spade.xmpp.simplexml.Node.setNamespace()=spade.xmpp.simplexml.Node-class.html#setNamespace"><a title="spade.xmpp.simplexml.Node.setNamespace" class="py-name" href="#" onclick="return doclink('link-269', 'setNamespace', 'link-269');">setNamespace</a></tt><tt class="py-op">(</tt><tt id="link-270" class="py-name"><a title="spade.Agent.NS_BIND
spade.MTP.NS_BIND
spade.Organization.NS_BIND
spade.Organization_new.NS_BIND
spade.Unit.NS_BIND
spade.Unit_new.NS_BIND
spade.pubsub.NS_BIND
spade.socialnetwork.NS_BIND
spade.xmpp.NS_BIND
spade.xmpp.auth.NS_BIND
spade.xmpp.browser.NS_BIND
spade.xmpp.commands.NS_BIND
spade.xmpp.dispatcher.NS_BIND
spade.xmpp.features.NS_BIND
spade.xmpp.filetransfer.NS_BIND
spade.xmpp.protocol.NS_BIND
spade.xmpp.roster.NS_BIND
spade.xmpp.transports.NS_BIND
spade.xmppd.modules.config.NS_BIND
spade.xmppd.modules.db_fake.NS_BIND
spade.xmppd.modules.dialback.NS_BIND
spade.xmppd.modules.jep0077.NS_BIND
spade.xmppd.modules.jep0078.NS_BIND
spade.xmppd.modules.message.NS_BIND
spade.xmppd.modules.muc.NS_BIND
spade.xmppd.modules.oob.NS_BIND
spade.xmppd.modules.pubsub.NS_BIND
spade.xmppd.modules.roster.NS_BIND
spade.xmppd.modules.router.NS_BIND
spade.xmppd.modules.stream.NS_BIND
spade.xmppd.modules.webadmin.NS_BIND
spade.xmppd.modules.wq.NS_BIND
spade.xmppd.xmppd.NS_BIND" class="py-name" href="#" onclick="return doclink('link-270', 'NS_BIND', 'link-237');">NS_BIND</a></tt><tt class="py-op">)</tt> </tt>
<a name="L318"></a><tt class="py-lineno">318</tt>  <tt class="py-line">            <tt class="py-name">rep</tt><tt class="py-op">.</tt><tt id="link-271" class="py-name"><a title="spade.xmpp.simplexml.T" class="py-name" href="#" onclick="return doclink('link-271', 'T', 'link-258');">T</a></tt><tt class="py-op">.</tt><tt class="py-name">bind</tt><tt class="py-op">.</tt><tt id="link-272" class="py-name"><a title="spade.xmpp.simplexml.NT" class="py-name" href="#" onclick="return doclink('link-272', 'NT', 'link-268');">NT</a></tt><tt class="py-op">.</tt><tt class="py-name">jid</tt><tt class="py-op">=</tt><tt class="py-name">fulljid</tt> </tt>
<a name="L319"></a><tt class="py-lineno">319</tt>  <tt class="py-line">            <tt id="link-273" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-273', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-274" class="py-name"><a title="spade.Agent.AbstractAgent.send
spade.MTP.MTP.send
spade.xmpp.dispatcher.Dispatcher.send
spade.xmpp.transports.TCPsocket.send
spade.xmppd.xmppd.RPC_Client.send
spade.xmppd.xmppd.Session.send" class="py-name" href="#" onclick="return doclink('link-274', 'send', 'link-25');">send</a></tt><tt class="py-op">(</tt><tt class="py-name">rep</tt><tt class="py-op">)</tt> </tt>
<a name="L320"></a><tt class="py-lineno">320</tt>  <tt class="py-line">            <tt id="link-275" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-275', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-276" class="py-name"><a title="spade.xmpp.session.Session.set_session_state
spade.xmppd.xmppd.Session.set_session_state" class="py-name" href="#" onclick="return doclink('link-276', 'set_session_state', 'link-156');">set_session_state</a></tt><tt class="py-op">(</tt><tt id="link-277" class="py-name"><a title="spade.xmpp.session.SESSION_BOUND
spade.xmppd.modules.router.SESSION_BOUND
spade.xmppd.modules.stream.SESSION_BOUND
spade.xmppd.xmppd.SESSION_BOUND" class="py-name" href="#" onclick="return doclink('link-277', 'SESSION_BOUND', 'link-160');">SESSION_BOUND</a></tt><tt class="py-op">)</tt> </tt>
<a name="L321"></a><tt class="py-lineno">321</tt>  <tt class="py-line">        <tt class="py-keyword">raise</tt> <tt id="link-278" class="py-name"><a title="spade.xmpp.protocol.NodeProcessed" class="py-name" href="#" onclick="return doclink('link-278', 'NodeProcessed', 'link-32');">NodeProcessed</a></tt> </tt>
</div></div><a name="L322"></a><tt class="py-lineno">322</tt>  <tt class="py-line"> </tt>
<a name="Session"></a><div id="Session-def"><a name="L323"></a><tt class="py-lineno">323</tt> <a class="py-toggle" href="#" id="Session-toggle" onclick="return toggle('Session');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="spade.xmppd.modules.stream.Session-class.html">Session</a><tt class="py-op">(</tt><tt class="py-base-class">PlugIn</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Session-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="Session-expanded"><a name="L324"></a><tt class="py-lineno">324</tt>  <tt class="py-line">    <tt id="link-279" class="py-name"><a title="spade.xmppd.modules.config.Config.NS
spade.xmppd.modules.db_fake.AUTH.NS
spade.xmppd.modules.db_fake.DB.NS
spade.xmppd.modules.dialback.Dialback.NS
spade.xmppd.modules.jep0077.IBR.NS
spade.xmppd.modules.jep0078.NSA.NS
spade.xmppd.modules.message.MessageCatcher.NS
spade.xmppd.modules.muc.MUC.NS
spade.xmppd.modules.oob.OOB.NS
spade.xmppd.modules.pubsub.PubSubServer.NS
spade.xmppd.modules.roster.ROSTER.NS
spade.xmppd.modules.router.Router.NS
spade.xmppd.modules.stream.Bind.NS
spade.xmppd.modules.stream.Handshake.NS
spade.xmppd.modules.stream.SASL.NS
spade.xmppd.modules.stream.Session.NS
spade.xmppd.modules.stream.TLS.NS
spade.xmppd.modules.webadmin.WebAdmin.NS
spade.xmppd.modules.wq.WQ.NS" class="py-name" href="#" onclick="return doclink('link-279', 'NS', 'link-4');">NS</a></tt><tt class="py-op">=</tt><tt id="link-280" class="py-name" targets="Variable spade.Agent.NS_SESSION=spade.Agent-module.html#NS_SESSION,Variable spade.MTP.NS_SESSION=spade.MTP-module.html#NS_SESSION,Variable spade.Organization.NS_SESSION=spade.Organization-module.html#NS_SESSION,Variable spade.Organization_new.NS_SESSION=spade.Organization_new-module.html#NS_SESSION,Variable spade.Unit.NS_SESSION=spade.Unit-module.html#NS_SESSION,Variable spade.Unit_new.NS_SESSION=spade.Unit_new-module.html#NS_SESSION,Variable spade.pubsub.NS_SESSION=spade.pubsub-module.html#NS_SESSION,Variable spade.socialnetwork.NS_SESSION=spade.socialnetwork-module.html#NS_SESSION,Variable spade.xmpp.NS_SESSION=spade.xmpp-module.html#NS_SESSION,Variable spade.xmpp.auth.NS_SESSION=spade.xmpp.auth-module.html#NS_SESSION,Variable spade.xmpp.browser.NS_SESSION=spade.xmpp.browser-module.html#NS_SESSION,Variable spade.xmpp.commands.NS_SESSION=spade.xmpp.commands-module.html#NS_SESSION,Variable spade.xmpp.dispatcher.NS_SESSION=spade.xmpp.dispatcher-module.html#NS_SESSION,Variable spade.xmpp.features.NS_SESSION=spade.xmpp.features-module.html#NS_SESSION,Variable spade.xmpp.filetransfer.NS_SESSION=spade.xmpp.filetransfer-module.html#NS_SESSION,Variable spade.xmpp.protocol.NS_SESSION=spade.xmpp.protocol-module.html#NS_SESSION,Variable spade.xmpp.roster.NS_SESSION=spade.xmpp.roster-module.html#NS_SESSION,Variable spade.xmpp.transports.NS_SESSION=spade.xmpp.transports-module.html#NS_SESSION,Variable spade.xmppd.modules.config.NS_SESSION=spade.xmppd.modules.config-module.html#NS_SESSION,Variable spade.xmppd.modules.db_fake.NS_SESSION=spade.xmppd.modules.db_fake-module.html#NS_SESSION,Variable spade.xmppd.modules.dialback.NS_SESSION=spade.xmppd.modules.dialback-module.html#NS_SESSION,Variable spade.xmppd.modules.jep0077.NS_SESSION=spade.xmppd.modules.jep0077-module.html#NS_SESSION,Variable spade.xmppd.modules.jep0078.NS_SESSION=spade.xmppd.modules.jep0078-module.html#NS_SESSION,Variable spade.xmppd.modules.message.NS_SESSION=spade.xmppd.modules.message-module.html#NS_SESSION,Variable spade.xmppd.modules.muc.NS_SESSION=spade.xmppd.modules.muc-module.html#NS_SESSION,Variable spade.xmppd.modules.oob.NS_SESSION=spade.xmppd.modules.oob-module.html#NS_SESSION,Variable spade.xmppd.modules.pubsub.NS_SESSION=spade.xmppd.modules.pubsub-module.html#NS_SESSION,Variable spade.xmppd.modules.roster.NS_SESSION=spade.xmppd.modules.roster-module.html#NS_SESSION,Variable spade.xmppd.modules.router.NS_SESSION=spade.xmppd.modules.router-module.html#NS_SESSION,Variable spade.xmppd.modules.stream.NS_SESSION=spade.xmppd.modules.stream-module.html#NS_SESSION,Variable spade.xmppd.modules.webadmin.NS_SESSION=spade.xmppd.modules.webadmin-module.html#NS_SESSION,Variable spade.xmppd.modules.wq.NS_SESSION=spade.xmppd.modules.wq-module.html#NS_SESSION,Variable spade.xmppd.xmppd.NS_SESSION=spade.xmppd.xmppd-module.html#NS_SESSION"><a title="spade.Agent.NS_SESSION
spade.MTP.NS_SESSION
spade.Organization.NS_SESSION
spade.Organization_new.NS_SESSION
spade.Unit.NS_SESSION
spade.Unit_new.NS_SESSION
spade.pubsub.NS_SESSION
spade.socialnetwork.NS_SESSION
spade.xmpp.NS_SESSION
spade.xmpp.auth.NS_SESSION
spade.xmpp.browser.NS_SESSION
spade.xmpp.commands.NS_SESSION
spade.xmpp.dispatcher.NS_SESSION
spade.xmpp.features.NS_SESSION
spade.xmpp.filetransfer.NS_SESSION
spade.xmpp.protocol.NS_SESSION
spade.xmpp.roster.NS_SESSION
spade.xmpp.transports.NS_SESSION
spade.xmppd.modules.config.NS_SESSION
spade.xmppd.modules.db_fake.NS_SESSION
spade.xmppd.modules.dialback.NS_SESSION
spade.xmppd.modules.jep0077.NS_SESSION
spade.xmppd.modules.jep0078.NS_SESSION
spade.xmppd.modules.message.NS_SESSION
spade.xmppd.modules.muc.NS_SESSION
spade.xmppd.modules.oob.NS_SESSION
spade.xmppd.modules.pubsub.NS_SESSION
spade.xmppd.modules.roster.NS_SESSION
spade.xmppd.modules.router.NS_SESSION
spade.xmppd.modules.stream.NS_SESSION
spade.xmppd.modules.webadmin.NS_SESSION
spade.xmppd.modules.wq.NS_SESSION
spade.xmppd.xmppd.NS_SESSION" class="py-name" href="#" onclick="return doclink('link-280', 'NS_SESSION', 'link-280');">NS_SESSION</a></tt> </tt>
<a name="Session.plugin"></a><div id="Session.plugin-def"><a name="L325"></a><tt class="py-lineno">325</tt> <a class="py-toggle" href="#" id="Session.plugin-toggle" onclick="return toggle('Session.plugin');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="spade.xmppd.modules.stream.Session-class.html#plugin">plugin</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">server</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Session.plugin-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Session.plugin-expanded"><a name="L326"></a><tt class="py-lineno">326</tt>  <tt class="py-line">        <tt class="py-name">server</tt><tt class="py-op">.</tt><tt id="link-281" class="py-name"><a title="spade.xmpp.dispatcher.Dispatcher" class="py-name" href="#" onclick="return doclink('link-281', 'Dispatcher', 'link-6');">Dispatcher</a></tt><tt class="py-op">.</tt><tt id="link-282" class="py-name"><a title="spade.xmpp.dispatcher.Dispatcher.RegisterHandler" class="py-name" href="#" onclick="return doclink('link-282', 'RegisterHandler', 'link-7');">RegisterHandler</a></tt><tt class="py-op">(</tt><tt class="py-string">'iq'</tt><tt class="py-op">,</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-283" class="py-name" targets="Method spade.xmppd.modules.stream.Session.sessionHandler()=spade.xmppd.modules.stream.Session-class.html#sessionHandler"><a title="spade.xmppd.modules.stream.Session.sessionHandler" class="py-name" href="#" onclick="return doclink('link-283', 'sessionHandler', 'link-283');">sessionHandler</a></tt><tt class="py-op">,</tt><tt class="py-name">typ</tt><tt class="py-op">=</tt><tt class="py-string">'set'</tt><tt class="py-op">,</tt><tt class="py-name">ns</tt><tt class="py-op">=</tt><tt id="link-284" class="py-name"><a title="spade.Agent.NS_SESSION
spade.MTP.NS_SESSION
spade.Organization.NS_SESSION
spade.Organization_new.NS_SESSION
spade.Unit.NS_SESSION
spade.Unit_new.NS_SESSION
spade.pubsub.NS_SESSION
spade.socialnetwork.NS_SESSION
spade.xmpp.NS_SESSION
spade.xmpp.auth.NS_SESSION
spade.xmpp.browser.NS_SESSION
spade.xmpp.commands.NS_SESSION
spade.xmpp.dispatcher.NS_SESSION
spade.xmpp.features.NS_SESSION
spade.xmpp.filetransfer.NS_SESSION
spade.xmpp.protocol.NS_SESSION
spade.xmpp.roster.NS_SESSION
spade.xmpp.transports.NS_SESSION
spade.xmppd.modules.config.NS_SESSION
spade.xmppd.modules.db_fake.NS_SESSION
spade.xmppd.modules.dialback.NS_SESSION
spade.xmppd.modules.jep0077.NS_SESSION
spade.xmppd.modules.jep0078.NS_SESSION
spade.xmppd.modules.message.NS_SESSION
spade.xmppd.modules.muc.NS_SESSION
spade.xmppd.modules.oob.NS_SESSION
spade.xmppd.modules.pubsub.NS_SESSION
spade.xmppd.modules.roster.NS_SESSION
spade.xmppd.modules.router.NS_SESSION
spade.xmppd.modules.stream.NS_SESSION
spade.xmppd.modules.webadmin.NS_SESSION
spade.xmppd.modules.wq.NS_SESSION
spade.xmppd.xmppd.NS_SESSION" class="py-name" href="#" onclick="return doclink('link-284', 'NS_SESSION', 'link-280');">NS_SESSION</a></tt><tt class="py-op">,</tt><tt class="py-name">xmlns</tt><tt class="py-op">=</tt><tt id="link-285" class="py-name"><a title="spade.Agent.NS_CLIENT
spade.MTP.NS_CLIENT
spade.Organization.NS_CLIENT
spade.Organization_new.NS_CLIENT
spade.Unit.NS_CLIENT
spade.Unit_new.NS_CLIENT
spade.pubsub.NS_CLIENT
spade.socialnetwork.NS_CLIENT
spade.xmpp.NS_CLIENT
spade.xmpp.auth.NS_CLIENT
spade.xmpp.browser.NS_CLIENT
spade.xmpp.commands.NS_CLIENT
spade.xmpp.dispatcher.NS_CLIENT
spade.xmpp.features.NS_CLIENT
spade.xmpp.filetransfer.NS_CLIENT
spade.xmpp.protocol.NS_CLIENT
spade.xmpp.roster.NS_CLIENT
spade.xmpp.transports.NS_CLIENT
spade.xmppd.modules.config.NS_CLIENT
spade.xmppd.modules.db_fake.NS_CLIENT
spade.xmppd.modules.dialback.NS_CLIENT
spade.xmppd.modules.jep0077.NS_CLIENT
spade.xmppd.modules.jep0078.NS_CLIENT
spade.xmppd.modules.message.NS_CLIENT
spade.xmppd.modules.muc.NS_CLIENT
spade.xmppd.modules.oob.NS_CLIENT
spade.xmppd.modules.pubsub.NS_CLIENT
spade.xmppd.modules.roster.NS_CLIENT
spade.xmppd.modules.router.NS_CLIENT
spade.xmppd.modules.stream.NS_CLIENT
spade.xmppd.modules.webadmin.NS_CLIENT
spade.xmppd.modules.wq.NS_CLIENT
spade.xmppd.xmppd.NS_CLIENT" class="py-name" href="#" onclick="return doclink('link-285', 'NS_CLIENT', 'link-154');">NS_CLIENT</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L327"></a><tt class="py-lineno">327</tt>  <tt class="py-line"> </tt>
<a name="Session.sessionHandler"></a><div id="Session.sessionHandler-def"><a name="L328"></a><tt class="py-lineno">328</tt> <a class="py-toggle" href="#" id="Session.sessionHandler-toggle" onclick="return toggle('Session.sessionHandler');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="spade.xmppd.modules.stream.Session-class.html#sessionHandler">sessionHandler</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">session</tt><tt class="py-op">,</tt><tt class="py-param">stanza</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Session.sessionHandler-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Session.sessionHandler-expanded"><a name="L329"></a><tt class="py-lineno">329</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-286" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-286', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">_session_state</tt><tt class="py-op">&lt;</tt><tt id="link-287" class="py-name"><a title="spade.xmpp.session.SESSION_AUTHED
spade.xmppd.modules.router.SESSION_AUTHED
spade.xmppd.modules.stream.SESSION_AUTHED
spade.xmppd.xmppd.SESSION_AUTHED" class="py-name" href="#" onclick="return doclink('link-287', 'SESSION_AUTHED', 'link-157');">SESSION_AUTHED</a></tt><tt class="py-op">:</tt> </tt>
<a name="L330"></a><tt class="py-lineno">330</tt>  <tt class="py-line">            <tt id="link-288" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-288', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-289" class="py-name"><a title="spade.xmpp.session.Session.terminate_stream
spade.xmppd.xmppd.Session.terminate_stream" class="py-name" href="#" onclick="return doclink('link-289', 'terminate_stream', 'link-66');">terminate_stream</a></tt><tt class="py-op">(</tt><tt id="link-290" class="py-name"><a title="spade.Agent.STREAM_NOT_AUTHORIZED
spade.MTP.STREAM_NOT_AUTHORIZED
spade.Organization.STREAM_NOT_AUTHORIZED
spade.Organization_new.STREAM_NOT_AUTHORIZED
spade.Unit.STREAM_NOT_AUTHORIZED
spade.Unit_new.STREAM_NOT_AUTHORIZED
spade.pubsub.STREAM_NOT_AUTHORIZED
spade.socialnetwork.STREAM_NOT_AUTHORIZED
spade.xmpp.STREAM_NOT_AUTHORIZED
spade.xmpp.auth.STREAM_NOT_AUTHORIZED
spade.xmpp.browser.STREAM_NOT_AUTHORIZED
spade.xmpp.commands.STREAM_NOT_AUTHORIZED
spade.xmpp.dispatcher.STREAM_NOT_AUTHORIZED
spade.xmpp.features.STREAM_NOT_AUTHORIZED
spade.xmpp.filetransfer.STREAM_NOT_AUTHORIZED
spade.xmpp.protocol.STREAM_NOT_AUTHORIZED
spade.xmpp.roster.STREAM_NOT_AUTHORIZED
spade.xmpp.transports.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.config.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.db_fake.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.dialback.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.jep0077.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.jep0078.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.message.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.muc.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.oob.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.pubsub.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.roster.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.router.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.stream.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.webadmin.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.wq.STREAM_NOT_AUTHORIZED
spade.xmppd.xmppd.STREAM_NOT_AUTHORIZED" class="py-name" href="#" onclick="return doclink('link-290', 'STREAM_NOT_AUTHORIZED', 'link-254');">STREAM_NOT_AUTHORIZED</a></tt><tt class="py-op">)</tt> </tt>
<a name="L331"></a><tt class="py-lineno">331</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt id="link-291" class="py-name"><a title="spade.xmpp.protocol.NodeProcessed" class="py-name" href="#" onclick="return doclink('link-291', 'NodeProcessed', 'link-32');">NodeProcessed</a></tt> </tt>
<a name="L332"></a><tt class="py-lineno">332</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-292" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-292', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">xmlns</tt><tt class="py-op">&lt;&gt;</tt><tt id="link-293" class="py-name"><a title="spade.Agent.NS_CLIENT
spade.MTP.NS_CLIENT
spade.Organization.NS_CLIENT
spade.Organization_new.NS_CLIENT
spade.Unit.NS_CLIENT
spade.Unit_new.NS_CLIENT
spade.pubsub.NS_CLIENT
spade.socialnetwork.NS_CLIENT
spade.xmpp.NS_CLIENT
spade.xmpp.auth.NS_CLIENT
spade.xmpp.browser.NS_CLIENT
spade.xmpp.commands.NS_CLIENT
spade.xmpp.dispatcher.NS_CLIENT
spade.xmpp.features.NS_CLIENT
spade.xmpp.filetransfer.NS_CLIENT
spade.xmpp.protocol.NS_CLIENT
spade.xmpp.roster.NS_CLIENT
spade.xmpp.transports.NS_CLIENT
spade.xmppd.modules.config.NS_CLIENT
spade.xmppd.modules.db_fake.NS_CLIENT
spade.xmppd.modules.dialback.NS_CLIENT
spade.xmppd.modules.jep0077.NS_CLIENT
spade.xmppd.modules.jep0078.NS_CLIENT
spade.xmppd.modules.message.NS_CLIENT
spade.xmppd.modules.muc.NS_CLIENT
spade.xmppd.modules.oob.NS_CLIENT
spade.xmppd.modules.pubsub.NS_CLIENT
spade.xmppd.modules.roster.NS_CLIENT
spade.xmppd.modules.router.NS_CLIENT
spade.xmppd.modules.stream.NS_CLIENT
spade.xmppd.modules.webadmin.NS_CLIENT
spade.xmppd.modules.wq.NS_CLIENT
spade.xmppd.xmppd.NS_CLIENT" class="py-name" href="#" onclick="return doclink('link-293', 'NS_CLIENT', 'link-154');">NS_CLIENT</a></tt> \ </tt>
<a name="L333"></a><tt class="py-lineno">333</tt>  <tt class="py-line">          <tt class="py-keyword">or</tt> <tt id="link-294" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-294', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">_session_state</tt><tt class="py-op">&lt;</tt><tt id="link-295" class="py-name"><a title="spade.xmpp.session.SESSION_BOUND
spade.xmppd.modules.router.SESSION_BOUND
spade.xmppd.modules.stream.SESSION_BOUND
spade.xmppd.xmppd.SESSION_BOUND" class="py-name" href="#" onclick="return doclink('link-295', 'SESSION_BOUND', 'link-160');">SESSION_BOUND</a></tt> \ </tt>
<a name="L334"></a><tt class="py-lineno">334</tt>  <tt class="py-line">          <tt class="py-keyword">or</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_owner</tt><tt class="py-op">.</tt><tt id="link-296" class="py-name" targets="Method spade.xmppd.xmppd.Server.getsession()=spade.xmppd.xmppd.Server-class.html#getsession"><a title="spade.xmppd.xmppd.Server.getsession" class="py-name" href="#" onclick="return doclink('link-296', 'getsession', 'link-296');">getsession</a></tt><tt class="py-op">(</tt><tt id="link-297" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-297', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">peer</tt><tt class="py-op">)</tt><tt class="py-op">==</tt><tt id="link-298" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-298', 'session', 'link-22');">session</a></tt><tt class="py-op">:</tt> </tt>
<a name="L335"></a><tt class="py-lineno">335</tt>  <tt class="py-line">            <tt id="link-299" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-299', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-300" class="py-name"><a title="spade.Agent.AbstractAgent.send
spade.MTP.MTP.send
spade.xmpp.dispatcher.Dispatcher.send
spade.xmpp.transports.TCPsocket.send
spade.xmppd.xmppd.RPC_Client.send
spade.xmppd.xmppd.Session.send" class="py-name" href="#" onclick="return doclink('link-300', 'send', 'link-25');">send</a></tt><tt class="py-op">(</tt><tt id="link-301" class="py-name"><a title="spade.xmpp.protocol.Error" class="py-name" href="#" onclick="return doclink('link-301', 'Error', 'link-248');">Error</a></tt><tt class="py-op">(</tt><tt class="py-name">stanza</tt><tt class="py-op">,</tt><tt id="link-302" class="py-name"><a title="spade.Agent.ERR_SERVICE_UNAVAILABLE
spade.MTP.ERR_SERVICE_UNAVAILABLE
spade.Organization.ERR_SERVICE_UNAVAILABLE
spade.Organization_new.ERR_SERVICE_UNAVAILABLE
spade.Unit.ERR_SERVICE_UNAVAILABLE
spade.Unit_new.ERR_SERVICE_UNAVAILABLE
spade.pubsub.ERR_SERVICE_UNAVAILABLE
spade.socialnetwork.ERR_SERVICE_UNAVAILABLE
spade.xmpp.ERR_SERVICE_UNAVAILABLE
spade.xmpp.auth.ERR_SERVICE_UNAVAILABLE
spade.xmpp.browser.ERR_SERVICE_UNAVAILABLE
spade.xmpp.commands.ERR_SERVICE_UNAVAILABLE
spade.xmpp.dispatcher.ERR_SERVICE_UNAVAILABLE
spade.xmpp.features.ERR_SERVICE_UNAVAILABLE
spade.xmpp.filetransfer.ERR_SERVICE_UNAVAILABLE
spade.xmpp.protocol.ERR_SERVICE_UNAVAILABLE
spade.xmpp.roster.ERR_SERVICE_UNAVAILABLE
spade.xmpp.transports.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.config.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.db_fake.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.dialback.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.jep0077.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.jep0078.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.message.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.muc.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.oob.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.pubsub.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.roster.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.router.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.stream.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.webadmin.ERR_SERVICE_UNAVAILABLE
spade.xmppd.modules.wq.ERR_SERVICE_UNAVAILABLE
spade.xmppd.xmppd.ERR_SERVICE_UNAVAILABLE" class="py-name" href="#" onclick="return doclink('link-302', 'ERR_SERVICE_UNAVAILABLE', 'link-249');">ERR_SERVICE_UNAVAILABLE</a></tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L336"></a><tt class="py-lineno">336</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L337"></a><tt class="py-lineno">337</tt>  <tt class="py-line">            <tt id="link-303" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-303', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-304" class="py-name"><a title="spade.xmpp.session.Session.set_session_state
spade.xmppd.xmppd.Session.set_session_state" class="py-name" href="#" onclick="return doclink('link-304', 'set_session_state', 'link-156');">set_session_state</a></tt><tt class="py-op">(</tt><tt id="link-305" class="py-name" targets="Variable spade.xmpp.session.SESSION_OPENED=spade.xmpp.session-module.html#SESSION_OPENED,Variable spade.xmppd.modules.router.SESSION_OPENED=spade.xmppd.modules.router-module.html#SESSION_OPENED,Variable spade.xmppd.modules.stream.SESSION_OPENED=spade.xmppd.modules.stream-module.html#SESSION_OPENED,Variable spade.xmppd.xmppd.SESSION_OPENED=spade.xmppd.xmppd-module.html#SESSION_OPENED"><a title="spade.xmpp.session.SESSION_OPENED
spade.xmppd.modules.router.SESSION_OPENED
spade.xmppd.modules.stream.SESSION_OPENED
spade.xmppd.xmppd.SESSION_OPENED" class="py-name" href="#" onclick="return doclink('link-305', 'SESSION_OPENED', 'link-305');">SESSION_OPENED</a></tt><tt class="py-op">)</tt> </tt>
<a name="L338"></a><tt class="py-lineno">338</tt>  <tt class="py-line">            <tt id="link-306" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-306', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-307" class="py-name"><a title="spade.Agent.AbstractAgent.send
spade.MTP.MTP.send
spade.xmpp.dispatcher.Dispatcher.send
spade.xmpp.transports.TCPsocket.send
spade.xmppd.xmppd.RPC_Client.send
spade.xmppd.xmppd.Session.send" class="py-name" href="#" onclick="return doclink('link-307', 'send', 'link-25');">send</a></tt><tt class="py-op">(</tt><tt class="py-name">stanza</tt><tt class="py-op">.</tt><tt id="link-308" class="py-name"><a title="spade.xmpp.protocol.Iq.buildReply
spade.xmpp.protocol.Message.buildReply" class="py-name" href="#" onclick="return doclink('link-308', 'buildReply', 'link-267');">buildReply</a></tt><tt class="py-op">(</tt><tt class="py-string">'result'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L339"></a><tt class="py-lineno">339</tt>  <tt class="py-line">        <tt class="py-keyword">raise</tt> <tt id="link-309" class="py-name"><a title="spade.xmpp.protocol.NodeProcessed" class="py-name" href="#" onclick="return doclink('link-309', 'NodeProcessed', 'link-32');">NodeProcessed</a></tt> </tt>
</div></div><a name="L340"></a><tt class="py-lineno">340</tt>  <tt class="py-line"> </tt>
<a name="L341"></a><tt class="py-lineno">341</tt>  <tt class="py-line"> </tt>
<a name="Handshake"></a><div id="Handshake-def"><a name="L342"></a><tt class="py-lineno">342</tt> <a class="py-toggle" href="#" id="Handshake-toggle" onclick="return toggle('Handshake');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="spade.xmppd.modules.stream.Handshake-class.html">Handshake</a><tt class="py-op">(</tt><tt class="py-base-class">PlugIn</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Handshake-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="Handshake-expanded"><a name="L343"></a><tt class="py-lineno">343</tt>  <tt class="py-line">        <tt id="link-310" class="py-name"><a title="spade.xmppd.modules.config.Config.NS
spade.xmppd.modules.db_fake.AUTH.NS
spade.xmppd.modules.db_fake.DB.NS
spade.xmppd.modules.dialback.Dialback.NS
spade.xmppd.modules.jep0077.IBR.NS
spade.xmppd.modules.jep0078.NSA.NS
spade.xmppd.modules.message.MessageCatcher.NS
spade.xmppd.modules.muc.MUC.NS
spade.xmppd.modules.oob.OOB.NS
spade.xmppd.modules.pubsub.PubSubServer.NS
spade.xmppd.modules.roster.ROSTER.NS
spade.xmppd.modules.router.Router.NS
spade.xmppd.modules.stream.Bind.NS
spade.xmppd.modules.stream.Handshake.NS
spade.xmppd.modules.stream.SASL.NS
spade.xmppd.modules.stream.Session.NS
spade.xmppd.modules.stream.TLS.NS
spade.xmppd.modules.webadmin.WebAdmin.NS
spade.xmppd.modules.wq.WQ.NS" class="py-name" href="#" onclick="return doclink('link-310', 'NS', 'link-4');">NS</a></tt><tt class="py-op">=</tt><tt id="link-311" class="py-name" targets="Variable spade.Agent.NS_COMPONENT_ACCEPT=spade.Agent-module.html#NS_COMPONENT_ACCEPT,Variable spade.MTP.NS_COMPONENT_ACCEPT=spade.MTP-module.html#NS_COMPONENT_ACCEPT,Variable spade.Organization.NS_COMPONENT_ACCEPT=spade.Organization-module.html#NS_COMPONENT_ACCEPT,Variable spade.Organization_new.NS_COMPONENT_ACCEPT=spade.Organization_new-module.html#NS_COMPONENT_ACCEPT,Variable spade.Unit.NS_COMPONENT_ACCEPT=spade.Unit-module.html#NS_COMPONENT_ACCEPT,Variable spade.Unit_new.NS_COMPONENT_ACCEPT=spade.Unit_new-module.html#NS_COMPONENT_ACCEPT,Variable spade.pubsub.NS_COMPONENT_ACCEPT=spade.pubsub-module.html#NS_COMPONENT_ACCEPT,Variable spade.socialnetwork.NS_COMPONENT_ACCEPT=spade.socialnetwork-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmpp.NS_COMPONENT_ACCEPT=spade.xmpp-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmpp.auth.NS_COMPONENT_ACCEPT=spade.xmpp.auth-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmpp.browser.NS_COMPONENT_ACCEPT=spade.xmpp.browser-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmpp.commands.NS_COMPONENT_ACCEPT=spade.xmpp.commands-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmpp.dispatcher.NS_COMPONENT_ACCEPT=spade.xmpp.dispatcher-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmpp.features.NS_COMPONENT_ACCEPT=spade.xmpp.features-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmpp.filetransfer.NS_COMPONENT_ACCEPT=spade.xmpp.filetransfer-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmpp.protocol.NS_COMPONENT_ACCEPT=spade.xmpp.protocol-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmpp.roster.NS_COMPONENT_ACCEPT=spade.xmpp.roster-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmpp.transports.NS_COMPONENT_ACCEPT=spade.xmpp.transports-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmppd.modules.config.NS_COMPONENT_ACCEPT=spade.xmppd.modules.config-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmppd.modules.db_fake.NS_COMPONENT_ACCEPT=spade.xmppd.modules.db_fake-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmppd.modules.dialback.NS_COMPONENT_ACCEPT=spade.xmppd.modules.dialback-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmppd.modules.jep0077.NS_COMPONENT_ACCEPT=spade.xmppd.modules.jep0077-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmppd.modules.jep0078.NS_COMPONENT_ACCEPT=spade.xmppd.modules.jep0078-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmppd.modules.message.NS_COMPONENT_ACCEPT=spade.xmppd.modules.message-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmppd.modules.muc.NS_COMPONENT_ACCEPT=spade.xmppd.modules.muc-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmppd.modules.oob.NS_COMPONENT_ACCEPT=spade.xmppd.modules.oob-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmppd.modules.pubsub.NS_COMPONENT_ACCEPT=spade.xmppd.modules.pubsub-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmppd.modules.roster.NS_COMPONENT_ACCEPT=spade.xmppd.modules.roster-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmppd.modules.router.NS_COMPONENT_ACCEPT=spade.xmppd.modules.router-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmppd.modules.stream.NS_COMPONENT_ACCEPT=spade.xmppd.modules.stream-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmppd.modules.webadmin.NS_COMPONENT_ACCEPT=spade.xmppd.modules.webadmin-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmppd.modules.wq.NS_COMPONENT_ACCEPT=spade.xmppd.modules.wq-module.html#NS_COMPONENT_ACCEPT,Variable spade.xmppd.xmppd.NS_COMPONENT_ACCEPT=spade.xmppd.xmppd-module.html#NS_COMPONENT_ACCEPT"><a title="spade.Agent.NS_COMPONENT_ACCEPT
spade.MTP.NS_COMPONENT_ACCEPT
spade.Organization.NS_COMPONENT_ACCEPT
spade.Organization_new.NS_COMPONENT_ACCEPT
spade.Unit.NS_COMPONENT_ACCEPT
spade.Unit_new.NS_COMPONENT_ACCEPT
spade.pubsub.NS_COMPONENT_ACCEPT
spade.socialnetwork.NS_COMPONENT_ACCEPT
spade.xmpp.NS_COMPONENT_ACCEPT
spade.xmpp.auth.NS_COMPONENT_ACCEPT
spade.xmpp.browser.NS_COMPONENT_ACCEPT
spade.xmpp.commands.NS_COMPONENT_ACCEPT
spade.xmpp.dispatcher.NS_COMPONENT_ACCEPT
spade.xmpp.features.NS_COMPONENT_ACCEPT
spade.xmpp.filetransfer.NS_COMPONENT_ACCEPT
spade.xmpp.protocol.NS_COMPONENT_ACCEPT
spade.xmpp.roster.NS_COMPONENT_ACCEPT
spade.xmpp.transports.NS_COMPONENT_ACCEPT
spade.xmppd.modules.config.NS_COMPONENT_ACCEPT
spade.xmppd.modules.db_fake.NS_COMPONENT_ACCEPT
spade.xmppd.modules.dialback.NS_COMPONENT_ACCEPT
spade.xmppd.modules.jep0077.NS_COMPONENT_ACCEPT
spade.xmppd.modules.jep0078.NS_COMPONENT_ACCEPT
spade.xmppd.modules.message.NS_COMPONENT_ACCEPT
spade.xmppd.modules.muc.NS_COMPONENT_ACCEPT
spade.xmppd.modules.oob.NS_COMPONENT_ACCEPT
spade.xmppd.modules.pubsub.NS_COMPONENT_ACCEPT
spade.xmppd.modules.roster.NS_COMPONENT_ACCEPT
spade.xmppd.modules.router.NS_COMPONENT_ACCEPT
spade.xmppd.modules.stream.NS_COMPONENT_ACCEPT
spade.xmppd.modules.webadmin.NS_COMPONENT_ACCEPT
spade.xmppd.modules.wq.NS_COMPONENT_ACCEPT
spade.xmppd.xmppd.NS_COMPONENT_ACCEPT" class="py-name" href="#" onclick="return doclink('link-311', 'NS_COMPONENT_ACCEPT', 'link-311');">NS_COMPONENT_ACCEPT</a></tt> </tt>
<a name="L344"></a><tt class="py-lineno">344</tt>  <tt class="py-line"> </tt>
<a name="Handshake.namespaceChangerAndRedirector"></a><div id="Handshake.namespaceChangerAndRedirector-def"><a name="L345"></a><tt class="py-lineno">345</tt> <a class="py-toggle" href="#" id="Handshake.namespaceChangerAndRedirector-toggle" onclick="return toggle('Handshake.namespaceChangerAndRedirector');">-</a><tt class="py-line">        <tt class="py-keyword">def</tt> <a class="py-def-name" href="spade.xmppd.modules.stream.Handshake-class.html#namespaceChangerAndRedirector">namespaceChangerAndRedirector</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">session</tt><tt class="py-op">,</tt><tt class="py-param">stanza</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Handshake.namespaceChangerAndRedirector-collapsed" style="display:none;" pad="+++" indent="++++++++++++"></div><div id="Handshake.namespaceChangerAndRedirector-expanded"><a name="L346"></a><tt class="py-lineno">346</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">stanza</tt><tt class="py-op">.</tt><tt id="link-312" class="py-name"><a title="spade.AID.aid.getName
spade.Agent.AbstractAgent.getName
spade.DF.DfAgentDescription.getName
spade.DF.Service.getName
spade.DF.ServiceDescription.getName
spade.pyparsing.ParseResults.getName
spade.xmpp.roster.Roster.getName
spade.xmpp.simplexml.Node.getName
spade.xmppd.modules.muc.Room.getName
spade.xmppd.modules.wq.Group.getName
spade.xmppd.xmppd.Session.getName" class="py-name" href="#" onclick="return doclink('link-312', 'getName', 'link-88');">getName</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-string">"handshake"</tt><tt class="py-op">:</tt> </tt>
<a name="L347"></a><tt class="py-lineno">347</tt>  <tt class="py-line">                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-313" class="py-name" targets="Method spade.xmpp.auth.NonSASL.handshakeHandler()=spade.xmpp.auth.NonSASL-class.html#handshakeHandler,Method spade.xmppd.modules.stream.Handshake.handshakeHandler()=spade.xmppd.modules.stream.Handshake-class.html#handshakeHandler"><a title="spade.xmpp.auth.NonSASL.handshakeHandler
spade.xmppd.modules.stream.Handshake.handshakeHandler" class="py-name" href="#" onclick="return doclink('link-313', 'handshakeHandler', 'link-313');">handshakeHandler</a></tt><tt class="py-op">(</tt><tt id="link-314" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-314', 'session', 'link-22');">session</a></tt><tt class="py-op">,</tt> <tt class="py-name">stanza</tt><tt class="py-op">)</tt> </tt>
<a name="L348"></a><tt class="py-lineno">348</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">stanza</tt><tt class="py-op">.</tt><tt id="link-315" class="py-name"><a title="spade.AID.aid.getName
spade.Agent.AbstractAgent.getName
spade.DF.DfAgentDescription.getName
spade.DF.Service.getName
spade.DF.ServiceDescription.getName
spade.pyparsing.ParseResults.getName
spade.xmpp.roster.Roster.getName
spade.xmpp.simplexml.Node.getName
spade.xmppd.modules.muc.Room.getName
spade.xmppd.modules.wq.Group.getName
spade.xmppd.xmppd.Session.getName" class="py-name" href="#" onclick="return doclink('link-315', 'getName', 'link-88');">getName</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-keyword">in</tt> <tt class="py-op">[</tt><tt class="py-string">'message'</tt><tt class="py-op">,</tt> <tt class="py-string">'iq'</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L349"></a><tt class="py-lineno">349</tt>  <tt class="py-line">                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-316" class="py-name"><a title="spade.Agent.AbstractAgent.DEBUG
spade.spade_backend.SpadeBackend.DEBUG
spade.xmpp.client.PlugIn.DEBUG
spade.xmpp.simplexml.NodeBuilder.DEBUG
spade.xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-316', 'DEBUG', 'link-28');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">"Redirecting stanza %s to router"</tt><tt class="py-op">%</tt><tt class="py-op">(</tt><tt class="py-name">stanza</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-string">"info"</tt><tt class="py-op">)</tt> </tt>
<a name="L350"></a><tt class="py-lineno">350</tt>  <tt class="py-line">                        <tt class="py-name">stanza</tt><tt class="py-op">.</tt><tt id="link-317" class="py-name"><a title="spade.xmpp.simplexml.Node.setNamespace" class="py-name" href="#" onclick="return doclink('link-317', 'setNamespace', 'link-269');">setNamespace</a></tt><tt class="py-op">(</tt><tt id="link-318" class="py-name"><a title="spade.Agent.NS_CLIENT
spade.MTP.NS_CLIENT
spade.Organization.NS_CLIENT
spade.Organization_new.NS_CLIENT
spade.Unit.NS_CLIENT
spade.Unit_new.NS_CLIENT
spade.pubsub.NS_CLIENT
spade.socialnetwork.NS_CLIENT
spade.xmpp.NS_CLIENT
spade.xmpp.auth.NS_CLIENT
spade.xmpp.browser.NS_CLIENT
spade.xmpp.commands.NS_CLIENT
spade.xmpp.dispatcher.NS_CLIENT
spade.xmpp.features.NS_CLIENT
spade.xmpp.filetransfer.NS_CLIENT
spade.xmpp.protocol.NS_CLIENT
spade.xmpp.roster.NS_CLIENT
spade.xmpp.transports.NS_CLIENT
spade.xmppd.modules.config.NS_CLIENT
spade.xmppd.modules.db_fake.NS_CLIENT
spade.xmppd.modules.dialback.NS_CLIENT
spade.xmppd.modules.jep0077.NS_CLIENT
spade.xmppd.modules.jep0078.NS_CLIENT
spade.xmppd.modules.message.NS_CLIENT
spade.xmppd.modules.muc.NS_CLIENT
spade.xmppd.modules.oob.NS_CLIENT
spade.xmppd.modules.pubsub.NS_CLIENT
spade.xmppd.modules.roster.NS_CLIENT
spade.xmppd.modules.router.NS_CLIENT
spade.xmppd.modules.stream.NS_CLIENT
spade.xmppd.modules.webadmin.NS_CLIENT
spade.xmppd.modules.wq.NS_CLIENT
spade.xmppd.xmppd.NS_CLIENT" class="py-name" href="#" onclick="return doclink('link-318', 'NS_CLIENT', 'link-154');">NS_CLIENT</a></tt><tt class="py-op">)</tt> </tt>
<a name="L351"></a><tt class="py-lineno">351</tt>  <tt class="py-line">                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">server</tt><tt class="py-op">.</tt><tt id="link-319" class="py-name" targets="Class spade.xmppd.modules.router.Router=spade.xmppd.modules.router.Router-class.html"><a title="spade.xmppd.modules.router.Router" class="py-name" href="#" onclick="return doclink('link-319', 'Router', 'link-319');">Router</a></tt><tt class="py-op">.</tt><tt id="link-320" class="py-name" targets="Method spade.xmppd.modules.router.Router.routerHandler()=spade.xmppd.modules.router.Router-class.html#routerHandler"><a title="spade.xmppd.modules.router.Router.routerHandler" class="py-name" href="#" onclick="return doclink('link-320', 'routerHandler', 'link-320');">routerHandler</a></tt><tt class="py-op">(</tt><tt id="link-321" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-321', 'session', 'link-22');">session</a></tt><tt class="py-op">,</tt><tt class="py-name">stanza</tt><tt class="py-op">)</tt> </tt>
<a name="L352"></a><tt class="py-lineno">352</tt>  <tt class="py-line">                <tt class="py-keyword">elif</tt> <tt class="py-name">stanza</tt><tt class="py-op">.</tt><tt id="link-322" class="py-name"><a title="spade.AID.aid.getName
spade.Agent.AbstractAgent.getName
spade.DF.DfAgentDescription.getName
spade.DF.Service.getName
spade.DF.ServiceDescription.getName
spade.pyparsing.ParseResults.getName
spade.xmpp.roster.Roster.getName
spade.xmpp.simplexml.Node.getName
spade.xmppd.modules.muc.Room.getName
spade.xmppd.modules.wq.Group.getName
spade.xmppd.xmppd.Session.getName" class="py-name" href="#" onclick="return doclink('link-322', 'getName', 'link-88');">getName</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-string">"presence"</tt><tt class="py-op">:</tt> </tt>
<a name="L353"></a><tt class="py-lineno">353</tt>  <tt class="py-line">                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-323" class="py-name"><a title="spade.Agent.AbstractAgent.DEBUG
spade.spade_backend.SpadeBackend.DEBUG
spade.xmpp.client.PlugIn.DEBUG
spade.xmpp.simplexml.NodeBuilder.DEBUG
spade.xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-323', 'DEBUG', 'link-28');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">"Redirecting stanza %s to router"</tt><tt class="py-op">%</tt><tt class="py-op">(</tt><tt class="py-name">stanza</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-string">"info"</tt><tt class="py-op">)</tt> </tt>
<a name="L354"></a><tt class="py-lineno">354</tt>  <tt class="py-line">                        <tt class="py-name">stanza</tt><tt class="py-op">.</tt><tt id="link-324" class="py-name"><a title="spade.xmpp.simplexml.Node.setNamespace" class="py-name" href="#" onclick="return doclink('link-324', 'setNamespace', 'link-269');">setNamespace</a></tt><tt class="py-op">(</tt><tt id="link-325" class="py-name"><a title="spade.Agent.NS_CLIENT
spade.MTP.NS_CLIENT
spade.Organization.NS_CLIENT
spade.Organization_new.NS_CLIENT
spade.Unit.NS_CLIENT
spade.Unit_new.NS_CLIENT
spade.pubsub.NS_CLIENT
spade.socialnetwork.NS_CLIENT
spade.xmpp.NS_CLIENT
spade.xmpp.auth.NS_CLIENT
spade.xmpp.browser.NS_CLIENT
spade.xmpp.commands.NS_CLIENT
spade.xmpp.dispatcher.NS_CLIENT
spade.xmpp.features.NS_CLIENT
spade.xmpp.filetransfer.NS_CLIENT
spade.xmpp.protocol.NS_CLIENT
spade.xmpp.roster.NS_CLIENT
spade.xmpp.transports.NS_CLIENT
spade.xmppd.modules.config.NS_CLIENT
spade.xmppd.modules.db_fake.NS_CLIENT
spade.xmppd.modules.dialback.NS_CLIENT
spade.xmppd.modules.jep0077.NS_CLIENT
spade.xmppd.modules.jep0078.NS_CLIENT
spade.xmppd.modules.message.NS_CLIENT
spade.xmppd.modules.muc.NS_CLIENT
spade.xmppd.modules.oob.NS_CLIENT
spade.xmppd.modules.pubsub.NS_CLIENT
spade.xmppd.modules.roster.NS_CLIENT
spade.xmppd.modules.router.NS_CLIENT
spade.xmppd.modules.stream.NS_CLIENT
spade.xmppd.modules.webadmin.NS_CLIENT
spade.xmppd.modules.wq.NS_CLIENT
spade.xmppd.xmppd.NS_CLIENT" class="py-name" href="#" onclick="return doclink('link-325', 'NS_CLIENT', 'link-154');">NS_CLIENT</a></tt><tt class="py-op">)</tt> </tt>
<a name="L355"></a><tt class="py-lineno">355</tt>  <tt class="py-line">                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">server</tt><tt class="py-op">.</tt><tt id="link-326" class="py-name"><a title="spade.xmppd.modules.router.Router" class="py-name" href="#" onclick="return doclink('link-326', 'Router', 'link-319');">Router</a></tt><tt class="py-op">.</tt><tt id="link-327" class="py-name" targets="Method spade.xmppd.modules.router.Router.presenceHandler()=spade.xmppd.modules.router.Router-class.html#presenceHandler"><a title="spade.xmppd.modules.router.Router.presenceHandler" class="py-name" href="#" onclick="return doclink('link-327', 'presenceHandler', 'link-327');">presenceHandler</a></tt><tt class="py-op">(</tt><tt id="link-328" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-328', 'session', 'link-22');">session</a></tt><tt class="py-op">,</tt><tt class="py-name">stanza</tt><tt class="py-op">)</tt> </tt>
<a name="L356"></a><tt class="py-lineno">356</tt>  <tt class="py-line">                <tt class="py-keyword">return</tt> </tt>
</div><a name="L357"></a><tt class="py-lineno">357</tt>  <tt class="py-line">                 </tt>
<a name="L358"></a><tt class="py-lineno">358</tt>  <tt class="py-line"> </tt>
<a name="Handshake.plugin"></a><div id="Handshake.plugin-def"><a name="L359"></a><tt class="py-lineno">359</tt> <a class="py-toggle" href="#" id="Handshake.plugin-toggle" onclick="return toggle('Handshake.plugin');">-</a><tt class="py-line">        <tt class="py-keyword">def</tt> <a class="py-def-name" href="spade.xmppd.modules.stream.Handshake-class.html#plugin">plugin</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">server</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Handshake.plugin-collapsed" style="display:none;" pad="+++" indent="++++++++++++"></div><div id="Handshake.plugin-expanded"><a name="L360"></a><tt class="py-lineno">360</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">server</tt> <tt class="py-op">=</tt> <tt class="py-name">server</tt> </tt>
<a name="L361"></a><tt class="py-lineno">361</tt>  <tt class="py-line">                <tt class="py-name">server</tt><tt class="py-op">.</tt><tt id="link-329" class="py-name"><a title="spade.xmpp.dispatcher.Dispatcher" class="py-name" href="#" onclick="return doclink('link-329', 'Dispatcher', 'link-6');">Dispatcher</a></tt><tt class="py-op">.</tt><tt id="link-330" class="py-name"><a title="spade.xmpp.dispatcher.Dispatcher.RegisterNamespaceHandler" class="py-name" href="#" onclick="return doclink('link-330', 'RegisterNamespaceHandler', 'link-136');">RegisterNamespaceHandler</a></tt><tt class="py-op">(</tt><tt id="link-331" class="py-name"><a title="spade.Agent.NS_COMPONENT_ACCEPT
spade.MTP.NS_COMPONENT_ACCEPT
spade.Organization.NS_COMPONENT_ACCEPT
spade.Organization_new.NS_COMPONENT_ACCEPT
spade.Unit.NS_COMPONENT_ACCEPT
spade.Unit_new.NS_COMPONENT_ACCEPT
spade.pubsub.NS_COMPONENT_ACCEPT
spade.socialnetwork.NS_COMPONENT_ACCEPT
spade.xmpp.NS_COMPONENT_ACCEPT
spade.xmpp.auth.NS_COMPONENT_ACCEPT
spade.xmpp.browser.NS_COMPONENT_ACCEPT
spade.xmpp.commands.NS_COMPONENT_ACCEPT
spade.xmpp.dispatcher.NS_COMPONENT_ACCEPT
spade.xmpp.features.NS_COMPONENT_ACCEPT
spade.xmpp.filetransfer.NS_COMPONENT_ACCEPT
spade.xmpp.protocol.NS_COMPONENT_ACCEPT
spade.xmpp.roster.NS_COMPONENT_ACCEPT
spade.xmpp.transports.NS_COMPONENT_ACCEPT
spade.xmppd.modules.config.NS_COMPONENT_ACCEPT
spade.xmppd.modules.db_fake.NS_COMPONENT_ACCEPT
spade.xmppd.modules.dialback.NS_COMPONENT_ACCEPT
spade.xmppd.modules.jep0077.NS_COMPONENT_ACCEPT
spade.xmppd.modules.jep0078.NS_COMPONENT_ACCEPT
spade.xmppd.modules.message.NS_COMPONENT_ACCEPT
spade.xmppd.modules.muc.NS_COMPONENT_ACCEPT
spade.xmppd.modules.oob.NS_COMPONENT_ACCEPT
spade.xmppd.modules.pubsub.NS_COMPONENT_ACCEPT
spade.xmppd.modules.roster.NS_COMPONENT_ACCEPT
spade.xmppd.modules.router.NS_COMPONENT_ACCEPT
spade.xmppd.modules.stream.NS_COMPONENT_ACCEPT
spade.xmppd.modules.webadmin.NS_COMPONENT_ACCEPT
spade.xmppd.modules.wq.NS_COMPONENT_ACCEPT
spade.xmppd.xmppd.NS_COMPONENT_ACCEPT" class="py-name" href="#" onclick="return doclink('link-331', 'NS_COMPONENT_ACCEPT', 'link-311');">NS_COMPONENT_ACCEPT</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-332" class="py-name" targets="Method spade.xmppd.modules.stream.Handshake.namespaceChangerAndRedirector()=spade.xmppd.modules.stream.Handshake-class.html#namespaceChangerAndRedirector"><a title="spade.xmppd.modules.stream.Handshake.namespaceChangerAndRedirector" class="py-name" href="#" onclick="return doclink('link-332', 'namespaceChangerAndRedirector', 'link-332');">namespaceChangerAndRedirector</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L362"></a><tt class="py-lineno">362</tt>  <tt class="py-line">                <tt class="py-comment">#server.Dispatcher.RegisterHandler('handshake',self.handshakeHandler,xmlns=NS_COMPONENT_ACCEPT)</tt> </tt>
<a name="L363"></a><tt class="py-lineno">363</tt>  <tt class="py-line">                <tt class="py-comment">#server.Dispatcher.RegisterHandler('presence',self.namespaceChangerAndRedirector,xmlns=NS_COMPONENT_ACCEPT)</tt> </tt>
<a name="L364"></a><tt class="py-lineno">364</tt>  <tt class="py-line">                <tt class="py-comment">#server.Dispatcher.RegisterHandler('message',self.namespaceChangerAndRedirector,xmlns=NS_COMPONENT_ACCEPT)</tt> </tt>
<a name="L365"></a><tt class="py-lineno">365</tt>  <tt class="py-line">                <tt class="py-comment">#server.Dispatcher.RegisterHandler('iq',self.namespaceChangerAndRedirector,xmlns=NS_COMPONENT_ACCEPT)</tt> </tt>
<a name="L366"></a><tt class="py-lineno">366</tt>  <tt class="py-line"> </tt>
<a name="Handshake.handshakeHandler"></a><div id="Handshake.handshakeHandler-def"><a name="L367"></a><tt class="py-lineno">367</tt> <a class="py-toggle" href="#" id="Handshake.handshakeHandler-toggle" onclick="return toggle('Handshake.handshakeHandler');">-</a><tt class="py-line">        <tt class="py-keyword">def</tt> <a class="py-def-name" href="spade.xmppd.modules.stream.Handshake-class.html#handshakeHandler">handshakeHandler</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">session</tt><tt class="py-op">,</tt> <tt class="py-param">stanza</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Handshake.handshakeHandler-collapsed" style="display:none;" pad="+++" indent="++++++++++++"></div><div id="Handshake.handshakeHandler-expanded"><a name="L368"></a><tt class="py-lineno">368</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-333" class="py-name"><a title="spade.Agent.AbstractAgent.DEBUG
spade.spade_backend.SpadeBackend.DEBUG
spade.xmpp.client.PlugIn.DEBUG
spade.xmpp.simplexml.NodeBuilder.DEBUG
spade.xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-333', 'DEBUG', 'link-28');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">'Handshake handler called'</tt><tt class="py-op">,</tt><tt class="py-string">'info'</tt><tt class="py-op">)</tt> </tt>
<a name="L369"></a><tt class="py-lineno">369</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt id="link-334" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-334', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">_session_state</tt> <tt class="py-op">&gt;=</tt> <tt id="link-335" class="py-name"><a title="spade.xmpp.session.SESSION_AUTHED
spade.xmppd.modules.router.SESSION_AUTHED
spade.xmppd.modules.stream.SESSION_AUTHED
spade.xmppd.xmppd.SESSION_AUTHED" class="py-name" href="#" onclick="return doclink('link-335', 'SESSION_AUTHED', 'link-157');">SESSION_AUTHED</a></tt><tt class="py-op">:</tt> </tt>
<a name="L370"></a><tt class="py-lineno">370</tt>  <tt class="py-line">                        <tt id="link-336" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-336', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-337" class="py-name"><a title="spade.xmpp.session.Session.terminate_stream
spade.xmppd.xmppd.Session.terminate_stream" class="py-name" href="#" onclick="return doclink('link-337', 'terminate_stream', 'link-66');">terminate_stream</a></tt><tt class="py-op">(</tt><tt id="link-338" class="py-name"><a title="spade.Agent.STREAM_NOT_AUTHORIZED
spade.MTP.STREAM_NOT_AUTHORIZED
spade.Organization.STREAM_NOT_AUTHORIZED
spade.Organization_new.STREAM_NOT_AUTHORIZED
spade.Unit.STREAM_NOT_AUTHORIZED
spade.Unit_new.STREAM_NOT_AUTHORIZED
spade.pubsub.STREAM_NOT_AUTHORIZED
spade.socialnetwork.STREAM_NOT_AUTHORIZED
spade.xmpp.STREAM_NOT_AUTHORIZED
spade.xmpp.auth.STREAM_NOT_AUTHORIZED
spade.xmpp.browser.STREAM_NOT_AUTHORIZED
spade.xmpp.commands.STREAM_NOT_AUTHORIZED
spade.xmpp.dispatcher.STREAM_NOT_AUTHORIZED
spade.xmpp.features.STREAM_NOT_AUTHORIZED
spade.xmpp.filetransfer.STREAM_NOT_AUTHORIZED
spade.xmpp.protocol.STREAM_NOT_AUTHORIZED
spade.xmpp.roster.STREAM_NOT_AUTHORIZED
spade.xmpp.transports.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.config.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.db_fake.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.dialback.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.jep0077.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.jep0078.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.message.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.muc.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.oob.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.pubsub.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.roster.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.router.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.stream.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.webadmin.STREAM_NOT_AUTHORIZED
spade.xmppd.modules.wq.STREAM_NOT_AUTHORIZED
spade.xmppd.xmppd.STREAM_NOT_AUTHORIZED" class="py-name" href="#" onclick="return doclink('link-338', 'STREAM_NOT_AUTHORIZED', 'link-254');">STREAM_NOT_AUTHORIZED</a></tt><tt class="py-op">)</tt> </tt>
<a name="L371"></a><tt class="py-lineno">371</tt>  <tt class="py-line">                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-339" class="py-name"><a title="spade.Agent.AbstractAgent.DEBUG
spade.spade_backend.SpadeBackend.DEBUG
spade.xmpp.client.PlugIn.DEBUG
spade.xmpp.simplexml.NodeBuilder.DEBUG
spade.xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-339', 'DEBUG', 'link-28');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">'Session already authed'</tt><tt class="py-op">,</tt><tt class="py-string">'warn'</tt><tt class="py-op">)</tt> </tt>
<a name="L372"></a><tt class="py-lineno">372</tt>  <tt class="py-line">                        <tt class="py-keyword">return</tt> </tt>
<a name="L373"></a><tt class="py-lineno">373</tt>  <tt class="py-line"> </tt>
<a name="L374"></a><tt class="py-lineno">374</tt>  <tt class="py-line">                <tt class="py-name">handshake</tt> <tt class="py-op">=</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">stanza</tt><tt class="py-op">.</tt><tt id="link-340" class="py-name"><a title="spade.xmpp.simplexml.Node.getData" class="py-name" href="#" onclick="return doclink('link-340', 'getData', 'link-193');">getData</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L375"></a><tt class="py-lineno">375</tt>  <tt class="py-line">                <tt class="py-keyword">for</tt> <tt class="py-name">k</tt><tt class="py-op">,</tt><tt class="py-name">v</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">server</tt><tt class="py-op">.</tt><tt id="link-341" class="py-name" targets="Variable spade.xmppd.modules.config.components=spade.xmppd.modules.config-module.html#components"><a title="spade.xmppd.modules.config.components" class="py-name" href="#" onclick="return doclink('link-341', 'components', 'link-341');">components</a></tt><tt class="py-op">.</tt><tt id="link-342" class="py-name" targets="Method spade.odict.odict.items()=spade.odict.odict-class.html#items,Method spade.pyparsing.ParseResults.items()=spade.pyparsing.ParseResults-class.html#items"><a title="spade.odict.odict.items
spade.pyparsing.ParseResults.items" class="py-name" href="#" onclick="return doclink('link-342', 'items', 'link-342');">items</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L376"></a><tt class="py-lineno">376</tt>  <tt class="py-line">                        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L377"></a><tt class="py-lineno">377</tt>  <tt class="py-line">                                <tt class="py-name">truehs</tt> <tt class="py-op">=</tt> <tt class="py-name">hashlib</tt><tt class="py-op">.</tt><tt class="py-name">sha1</tt><tt class="py-op">(</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt id="link-343" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-343', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-344" class="py-name"><a title="spade.xmpp.browser.ID
spade.xmpp.dispatcher.ID" class="py-name" href="#" onclick="return doclink('link-344', 'ID', 'link-261');">ID</a></tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-name">v</tt><tt class="py-op">[</tt><tt class="py-string">'password'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">hexdigest</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L378"></a><tt class="py-lineno">378</tt>  <tt class="py-line">                                <tt class="py-keyword">if</tt> <tt class="py-name">handshake</tt> <tt class="py-op">==</tt> <tt class="py-name">truehs</tt><tt class="py-op">:</tt> </tt>
<a name="L379"></a><tt class="py-lineno">379</tt>  <tt class="py-line">                                        <tt class="py-comment"># We have a match!! It's THIS component!!</tt> </tt>
<a name="L380"></a><tt class="py-lineno">380</tt>  <tt class="py-line">                                        <tt id="link-345" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-345', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt class="py-name">peer</tt><tt class="py-op">=</tt><tt class="py-name">v</tt><tt class="py-op">[</tt><tt class="py-string">'jid'</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">lower</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L381"></a><tt class="py-lineno">381</tt>  <tt class="py-line">                                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">server</tt><tt class="py-op">.</tt><tt id="link-346" class="py-name"><a title="spade.xmppd.xmppd.Server.activatesession" class="py-name" href="#" onclick="return doclink('link-346', 'activatesession', 'link-162');">activatesession</a></tt><tt class="py-op">(</tt><tt id="link-347" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-347', 'session', 'link-22');">session</a></tt><tt class="py-op">,</tt> <tt class="py-name">v</tt><tt class="py-op">[</tt><tt class="py-string">'jid'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L382"></a><tt class="py-lineno">382</tt>  <tt class="py-line">                                        <tt id="link-348" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-348', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-349" class="py-name"><a title="spade.xmpp.session.Session.set_session_state
spade.xmppd.xmppd.Session.set_session_state" class="py-name" href="#" onclick="return doclink('link-349', 'set_session_state', 'link-156');">set_session_state</a></tt><tt class="py-op">(</tt><tt id="link-350" class="py-name"><a title="spade.xmpp.session.SESSION_AUTHED
spade.xmppd.modules.router.SESSION_AUTHED
spade.xmppd.modules.stream.SESSION_AUTHED
spade.xmppd.xmppd.SESSION_AUTHED" class="py-name" href="#" onclick="return doclink('link-350', 'SESSION_AUTHED', 'link-157');">SESSION_AUTHED</a></tt><tt class="py-op">)</tt> </tt>
<a name="L383"></a><tt class="py-lineno">383</tt>  <tt class="py-line">                                        <tt id="link-351" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-351', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-352" class="py-name"><a title="spade.xmpp.session.Session.set_session_state
spade.xmppd.xmppd.Session.set_session_state" class="py-name" href="#" onclick="return doclink('link-352', 'set_session_state', 'link-156');">set_session_state</a></tt><tt class="py-op">(</tt><tt id="link-353" class="py-name"><a title="spade.xmpp.session.SESSION_OPENED
spade.xmppd.modules.router.SESSION_OPENED
spade.xmppd.modules.stream.SESSION_OPENED
spade.xmppd.xmppd.SESSION_OPENED" class="py-name" href="#" onclick="return doclink('link-353', 'SESSION_OPENED', 'link-305');">SESSION_OPENED</a></tt><tt class="py-op">)</tt> </tt>
<a name="L384"></a><tt class="py-lineno">384</tt>  <tt class="py-line">                                        <tt class="py-name">node</tt> <tt class="py-op">,</tt> <tt class="py-name">dom</tt> <tt class="py-op">=</tt> <tt class="py-name">v</tt><tt class="py-op">[</tt><tt class="py-string">"jid"</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">"."</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L385"></a><tt class="py-lineno">385</tt>  <tt class="py-line">                                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">server</tt><tt class="py-op">.</tt><tt id="link-354" class="py-name" targets="Class spade.xmppd.modules.db_fake.DB=spade.xmppd.modules.db_fake.DB-class.html"><a title="spade.xmppd.modules.db_fake.DB" class="py-name" href="#" onclick="return doclink('link-354', 'DB', 'link-354');">DB</a></tt><tt class="py-op">.</tt><tt id="link-355" class="py-name" targets="Method spade.xmppd.modules.db_fake.DB.register_user()=spade.xmppd.modules.db_fake.DB-class.html#register_user"><a title="spade.xmppd.modules.db_fake.DB.register_user" class="py-name" href="#" onclick="return doclink('link-355', 'register_user', 'link-355');">register_user</a></tt><tt class="py-op">(</tt><tt class="py-name">dom</tt><tt class="py-op">,</tt> <tt class="py-name">node</tt><tt class="py-op">,</tt> <tt class="py-name">v</tt><tt class="py-op">[</tt><tt class="py-string">'password'</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">v</tt><tt class="py-op">[</tt><tt class="py-string">'name'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L386"></a><tt class="py-lineno">386</tt>  <tt class="py-line">                                        <tt id="link-356" class="py-name"><a title="spade.xmpp.session" class="py-name" href="#" onclick="return doclink('link-356', 'session', 'link-22');">session</a></tt><tt class="py-op">.</tt><tt id="link-357" class="py-name"><a title="spade.Agent.AbstractAgent.send
spade.MTP.MTP.send
spade.xmpp.dispatcher.Dispatcher.send
spade.xmpp.transports.TCPsocket.send
spade.xmppd.xmppd.RPC_Client.send
spade.xmppd.xmppd.Session.send" class="py-name" href="#" onclick="return doclink('link-357', 'send', 'link-25');">send</a></tt><tt class="py-op">(</tt><tt id="link-358" class="py-name"><a title="spade.xmpp.simplexml.Node" class="py-name" href="#" onclick="return doclink('link-358', 'Node', 'link-26');">Node</a></tt><tt class="py-op">(</tt><tt class="py-string">'handshake'</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L387"></a><tt class="py-lineno">387</tt>  <tt class="py-line">                                        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-359" class="py-name"><a title="spade.Agent.AbstractAgent.DEBUG
spade.spade_backend.SpadeBackend.DEBUG
spade.xmpp.client.PlugIn.DEBUG
spade.xmpp.simplexml.NodeBuilder.DEBUG
spade.xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-359', 'DEBUG', 'link-28');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">'Component %s authenticated'</tt><tt class="py-op">%</tt><tt class="py-op">(</tt><tt class="py-name">v</tt><tt class="py-op">[</tt><tt class="py-string">'jid'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-string">'ok'</tt><tt class="py-op">)</tt> </tt>
<a name="L388"></a><tt class="py-lineno">388</tt>  <tt class="py-line">                                        <tt class="py-keyword">return</tt> </tt>
<a name="L389"></a><tt class="py-lineno">389</tt>  <tt class="py-line">                        <tt class="py-keyword">except</tt><tt class="py-op">:</tt> </tt>
<a name="L390"></a><tt class="py-lineno">390</tt>  <tt class="py-line">                                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-360" class="py-name"><a title="spade.Agent.AbstractAgent.DEBUG
spade.spade_backend.SpadeBackend.DEBUG
spade.xmpp.client.PlugIn.DEBUG
spade.xmpp.simplexml.NodeBuilder.DEBUG
spade.xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-360', 'DEBUG', 'link-28');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">'Error authenticating handshake'</tt><tt class="py-op">,</tt> <tt class="py-string">'error'</tt><tt class="py-op">)</tt> </tt>
<a name="L391"></a><tt class="py-lineno">391</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-361" class="py-name"><a title="spade.Agent.AbstractAgent.DEBUG
spade.spade_backend.SpadeBackend.DEBUG
spade.xmpp.client.PlugIn.DEBUG
spade.xmpp.simplexml.NodeBuilder.DEBUG
spade.xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-361', 'DEBUG', 'link-28');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">"Unknown component"</tt><tt class="py-op">,</tt><tt class="py-string">"warn"</tt><tt class="py-op">)</tt> </tt>
<a name="L392"></a><tt class="py-lineno">392</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-362" class="py-name"><a title="spade.Agent.AbstractAgent.DEBUG
spade.spade_backend.SpadeBackend.DEBUG
spade.xmpp.client.PlugIn.DEBUG
spade.xmpp.simplexml.NodeBuilder.DEBUG
spade.xmpp.transports.HTTPPROXYsocket.DEBUG" class="py-name" href="#" onclick="return doclink('link-362', 'DEBUG', 'link-28');">DEBUG</a></tt><tt class="py-op">(</tt><tt class="py-string">"Components: "</tt><tt class="py-op">+</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">server</tt><tt class="py-op">.</tt><tt id="link-363" class="py-name"><a title="spade.xmppd.modules.config.components" class="py-name" href="#" onclick="return doclink('link-363', 'components', 'link-341');">components</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-string">"warn"</tt><tt class="py-op">)</tt> </tt>
<a name="L393"></a><tt class="py-lineno">393</tt>  <tt class="py-line">                <tt class="py-keyword">return</tt> </tt>
</div></div><a name="L394"></a><tt class="py-lineno">394</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="spade-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://spade2.googlecode.com">SPADE</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Wed Aug  1 18:45:01 2012
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
